ROSE 0.11.145.192
|
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 Sawyer/CommandLine.h.
#include <Sawyer/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. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Protected Member Functions | |
virtual void | operator() (const ParserResult &)=0 |
Reference counting pointer for this class.
Definition at line 1615 of file Sawyer/CommandLine.h.
|
inlinevirtual |
Definition at line 1616 of file Sawyer/CommandLine.h.
|
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 Sawyer/CommandLine.h.