My Project
|
Database of root Action objects that can be used to transform a function. More...
#include <action.hh>
Public Member Functions | |
ActionDatabase (void) | |
Constructor. | |
~ActionDatabase (void) | |
Destructor. | |
void | registerUniversal (Action *act) |
Register the universal root Action. More... | |
Action * | getCurrent (void) const |
Get the current root Action. | |
const string & | getCurrentName (void) const |
Get the name of the current root Action. | |
const ActionGroupList & | getGroup (const string &grp) const |
Get a specific grouplist by name. | |
Action * | setCurrent (const string &actname) |
Set the current root Action. More... | |
Action * | toggleAction (const string &grp, const string &basegrp, bool val) |
Toggle a group of Actions with a root Action. More... | |
void | setGroup (const string &grp, const char **argv) |
Establish a new root Action. More... | |
void | cloneGroup (const string &oldname, const string &newname) |
Clone a root Action. More... | |
bool | addToGroup (const string &grp, const string &basegroup) |
Add a group to a root Action. More... | |
bool | removeFromGroup (const string &grp, const string &basegroup) |
Remove a group from a root Action. More... | |
Database of root Action objects that can be used to transform a function.
This is a container for Action objects. It also manages root Action objects, which encapsulate a complete transformation system that can be applied to functions. Root Action objects are derived from a single universal Action object that has every possible sub-action within it. A root Action has its own name and is derived from the universal via a grouplist, which lists a particular subset of Action and Rule groups to use for the root. A new root Action is created by providing a new grouplist via setGroup() or modifying an existing grouplist. This class is intended to be instantiated as a singleton and keeps track of the current root Action, which is the one that will be actively applied to functions.
bool ActionDatabase::addToGroup | ( | const string & | grp, |
const string & | basegroup | ||
) |
Add a group to a root Action.
Add a group to the grouplist for a particular root Action. Do not use to redefine a root Action that has already been instantiated.
grp | is the name of the root Action |
basegroup | is the group to add |
void ActionDatabase::cloneGroup | ( | const string & | oldname, |
const string & | newname | ||
) |
Clone a root Action.
Copy an existing root Action by copying its grouplist, giving it a new name. This is suitable for a copy then modify strategy to create a new root Action. Do not use to redefine a root Action that has already been instantiated
oldname | is the name of an existing root Action |
newname | is the name of the copy |
void ActionDatabase::registerUniversal | ( | Action * | act | ) |
bool ActionDatabase::removeFromGroup | ( | const string & | grp, |
const string & | basegrp | ||
) |
Action * ActionDatabase::setCurrent | ( | const string & | actname | ) |
void ActionDatabase::setGroup | ( | const string & | grp, |
const char ** | argv | ||
) |
Action * ActionDatabase::toggleAction | ( | const string & | grp, |
const string & | basegrp, | ||
bool | val | ||
) |
Toggle a group of Actions with a root Action.
A particular group is either added or removed from the grouplist defining a particular root Action. The root Action is then (re)derived from the universal
grp | is the name of the root Action |
basegrp | is name of group (within the grouplist) to toggle |
val | is true if the group should be added or false if it should be removed |