ROSE
0.11.96.11
|
Sums all previous and current values.
The template argument must match the type of the summed values.
This augmenter can be used for switches that increment a value, such as a debug switch where each occurrence of the switch increments a debug level:
Definition at line 1922 of file util/Sawyer/CommandLine.h.
#include <CommandLine.h>
Public Types | |
typedef SharedPointer< Sum > | Ptr |
Reference counting pointer for this class. | |
Public Types inherited from Sawyer::CommandLine::ValueAugmenter | |
typedef SharedPointer< ValueAugmenter > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
virtual ParsedValues | operator() (const ParsedValues &savedValues, const ParsedValues &newValues) |
Called when a switch's value is about to be stored into the ParserResult. 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... | |
Static Public Member Functions | |
static Ptr | instance () |
Allocating constructor. More... | |
Protected Member Functions | |
Sum () | |
Constructor for derived classes. More... | |
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1925 of file util/Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new Sum object. Uses will most likely want to use the sum factory instead, which requires less typing.
Definition at line 1934 of file util/Sawyer/CommandLine.h.
Referenced by Sawyer::CommandLine::sum().
|
inlinevirtual |
Called when a switch's value is about to be stored into the ParserResult.
The previously stored switch values for all switch occurrences that used this same key are provided in the first arugment. The recently parsed value (or values if the switch value was a list that was then exploded) is provided as the second argument. The function should return a new value (or values) that will replace the values passed on the command-line.
Implements Sawyer::CommandLine::ValueAugmenter.
Definition at line 1936 of file util/Sawyer/CommandLine.h.
References Sawyer::CommandLine::sum(), and Sawyer::CommandLine::ParsedValue::value().