An argument handler is an object that helps determine the value that is passed to a Command.
Argument handlers come into play when a command is invoked
without providing a explicit value for an argument, or when the
argument that was provided requires some processing before it can
be sent to the command. For example the Collection
argument handler can turn a string-based list of objects into a
CValueArray
representing those objects.
Argument handlers are widely used on built-in commands, and can be specified for custom commands (see ArgumentArray::AddWithHandler). They make it easier to implement flexible custom commands, and reduce the amount of error handling necessary inside the command implementation.
Once specified as part of the command definition they act behind the scenes during the process of the command invocation. Neither the caller nor the implementation need to explicitly manipulate ArgumentHandler objects.
#include <xsi_argumenthandler.h>
Public Member Functions |
|
ArgumentHandler () | |
~ArgumentHandler () | |
ArgumentHandler (const CRef &in_ref) | |
ArgumentHandler (const ArgumentHandler &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
ArgumentHandler & | operator= (const ArgumentHandler &in_obj) |
ArgumentHandler & | operator= (const CRef &in_ref) |
ArgumentHandler | ( | ) |
Default constructor.
~ArgumentHandler | ( | ) |
Default destructor.
ArgumentHandler | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
ArgumentHandler | ( | const ArgumentHandler & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from SIObject.
siClassID GetClassID | ( | ) | const [virtual] |
ArgumentHandler& operator= | ( | const ArgumentHandler & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
ArgumentHandler& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from SIObject.