ROSE
0.11.96.11
|
Base class for switch actions.
These objects represent some action that occurs after all switches are parsed and the ParserResult::apply method is called.
Actions are always allocated on the heap and reference counted. Each action defines a class factory method, instance
, to allocate a new object and return a pointer to it. The pointer types are named Ptr
and are defined within the class. For convenience, the actions built into the library also have global factory functions which have the same name as the class but start with an initial lower-case letter (see Command line action factories for details). For instance:
Definition at line 1612 of file util/Sawyer/CommandLine.h.
#include <CommandLine.h>
Public Types | |
typedef SharedPointer< SwitchAction > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
void | run (const ParserResult &parserResult) |
Runs the action. More... | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. More... | |
SharedObject (const SharedObject &) | |
Copy constructor. More... | |
virtual | ~SharedObject () |
Virtual destructor. More... | |
SharedObject & | operator= (const SharedObject &) |
Assignment. More... | |
Protected Member Functions | |
virtual void | operator() (const ParserResult &)=0 |
|
inline |
Runs the action.
Calling this method will cause the function operator to be invoked with the parser results.
Definition at line 1619 of file util/Sawyer/CommandLine.h.