#include <PlugInArgList.h>
Public Member Functions | |
| virtual void | emptyList ()=0 |
| template<typename T> | |
| bool | addArg (const std::string &name, const T &defaultValue, const std::string &description=std::string()) |
| template<typename T> | |
| bool | addArg (const std::string &name, const T *pDefaultValue, const std::string &description=std::string()) |
| template<typename T> | |
| bool | addArg (const std::string &name, const std::string &description=std::string()) |
| virtual bool | addArg (const PlugInArg &arg)=0 |
| template<typename T> | |
| T * | getPlugInArgValue (const std::string &name) const |
| template<typename T> | |
| T * | getPlugInArgValueUnsafe (const std::string &name) const |
| template<typename T> | |
| bool | getPlugInArgValue (const std::string &name, T &value) const |
| template<typename T> | |
| bool | setPlugInArgValue (const std::string &name, T *pValue) |
| template<typename T> | |
| bool | setPlugInArgValueLoose (const std::string &name, T *pValue) |
| virtual bool | getArg (const std::string &argName, PlugInArg *&arg) const =0 |
| virtual bool | getArg (int argNumber, PlugInArg *&arg) const =0 |
| virtual unsigned short | getCount () const =0 |
| virtual bool | catenateLists (const PlugInArgList &plugInArg)=0 |
Protected Member Functions | |
| virtual | ~PlugInArgList () |
This class is responsible for managing all plug-in arguments that are required for a plug-in argument list.
Tutorial/Tutorial1.cpp, Tutorial/Tutorial1.h, Tutorial/Tutorial2.cpp, Tutorial/Tutorial2.h, Tutorial/Tutorial3.cpp, Tutorial/Tutorial3.h, Tutorial/Tutorial4.cpp, Tutorial/Tutorial4.h, Tutorial/Tutorial5.cpp, and Tutorial/Tutorial5.h.
Definition at line 28 of file PlugInArgList.h.
| virtual PlugInArgList::~PlugInArgList | ( | ) | [protected, virtual] |
This should be destroyed by calling PlugInManagerServices::destroyPlugInArgList.
Definition at line 371 of file PlugInArgList.h.
| virtual void PlugInArgList::emptyList | ( | ) | [pure virtual] |
Empty the Plug-In Argument List.
The emptyList() method clears the vector of Plug-In Arguments, but does NOT destruct the individual Plug-In Arguments. It simply removes the references to them from the vector.
| bool PlugInArgList::addArg | ( | const std::string & | name, | |
| const T & | defaultValue, | |||
| const std::string & | description = std::string() | |||
| ) |
Add an argument to a PlugInArgList with a default.
| name | The name for the argument. | |
| defaultValue | The default value for the argument. | |
| description | The user-centric description for the argument. |
Definition at line 53 of file PlugInArgList.h.
| bool PlugInArgList::addArg | ( | const std::string & | name, | |
| const T * | pDefaultValue, | |||
| const std::string & | description = std::string() | |||
| ) |
Add an argument to a PlugInArgList with a default.
This version allows NULL defaults.
| name | The name for the argument. | |
| pDefaultValue | The default value for the argument as a pointer. | |
| description | The user-centric description for the argument. |
Definition at line 85 of file PlugInArgList.h.
| bool PlugInArgList::addArg | ( | const std::string & | name, | |
| const std::string & | description = std::string() | |||
| ) |
Add an argument to a PlugInArgList without a default.
| name | The name for the argument. | |
| description | The user-centric description for the argument. |
Definition at line 113 of file PlugInArgList.h.
| virtual bool PlugInArgList::addArg | ( | const PlugInArg & | arg | ) | [pure virtual] |
Add a Plug-In Argument to the list.
The addArg() method adds the given Plug-In Argument to the and of the existing Argument list, and returns a flag indicating whether it was successful.
| arg | Reference to the Plug-In Argument to be added to the list. |
| T* PlugInArgList::getPlugInArgValue | ( | const std::string & | name | ) | const |
Returns the actual or default value for this plug-in argument.
This version returns a pointer to the type requested. This is useful for model types which must always be used as pointers.
| name | The name of the plug-in argument to retrive. |
Definition at line 160 of file PlugInArgList.h.
| T* PlugInArgList::getPlugInArgValueUnsafe | ( | const std::string & | name | ) | const |
Returns the actual or default value for this plug-in argument.
This version returns a pointer to the type requested. This is useful for model types which must always be used as pointers.
| name | The name of the plug-in argument to retrive. |
Definition at line 189 of file PlugInArgList.h.
| bool PlugInArgList::getPlugInArgValue | ( | const std::string & | name, | |
| T & | value | |||
| ) | const |
Returns the actual or default value for this plug-in argument.
This version sets the output argument to the value of the requested plug-in argument. This version is useful for basic types and other types that have an equals operator.
| name | The name of the plug-in argument to retrive. | |
| value | Output argument which will contain the value of the argument. This will remain unchanged if the argument is not present in the arg list or there the actual and default values are not set. |
Definition at line 221 of file PlugInArgList.h.
| bool PlugInArgList::setPlugInArgValue | ( | const std::string & | name, | |
| T * | pValue | |||
| ) |
Sets the actual value for a plug-in argument.
| name | The name of the plug-in argument for which to set its value. | |
| pValue | The actual value of the argument. |
true if the value is successfully set into the arg. Returns false if the argument is not present in the arg list or if the type of the given value is not the same as the arg type.Definition at line 258 of file PlugInArgList.h.
| bool PlugInArgList::setPlugInArgValueLoose | ( | const std::string & | name, | |
| T * | pValue | |||
| ) |
Set the actual value for a plug-in argument.
This method performs loose type checking, which requires that T be a subclass of TypeAwareObject. If T is not the same or a subclass of the argument type, this method will fail.
| name | The name of the plug-in argument for which to set its value. | |
| pValue | The actual value of the argument. |
true if the value is successfully set into the arg. Returns false if the argument is not present in the arg list or if the type of the given value is not a kind of the arg type.Definition at line 288 of file PlugInArgList.h.
| virtual bool PlugInArgList::getArg | ( | const std::string & | argName, | |
| PlugInArg *& | arg | |||
| ) | const [pure virtual] |
Get a Plug-In Argument from the list.
The getArg() method sets an output parameter to point to the desired Plug-In Argument, if it exists, and returns a flag indicating success status.
| argName | Reference to the Plug-In Argument to be added to the list. | |
| arg | Pointer that will be set to the desired Plug-In Argument if found, or NULL if not found. |
| virtual bool PlugInArgList::getArg | ( | int | argNumber, | |
| PlugInArg *& | arg | |||
| ) | const [pure virtual] |
Get a Plug-In Argument from the list.
This method sets an output parameter to point to the desired Plug-In Argument, if it exists, and returns a flag indicating success status.
| argNumber | Index into the vector containing the Plug-In Argument List. Since arguments are always added to the end of the vector, it is possible to pull them back out using an offset number, rather than specifying the name of the Argument. An index of 0 corresponds to the first argument in the list, and an index of getCount()-1 corresponds to the last argument in the list. | |
| arg | Pointer that will be set to the desired Plug-In Argument if found, or NULL if not found. |
| virtual unsigned short PlugInArgList::getCount | ( | ) | const [pure virtual] |
Get the number of Arguments in the Plug-In Argument List.
The getCount() method returns the number of arguments that have been added to the list using addArg() or catenateLists().
| virtual bool PlugInArgList::catenateLists | ( | const PlugInArgList & | plugInArg | ) | [pure virtual] |
Concatenate a Plug-In Argument List to the end of this list.
The catenateLists() method adds each Argument in the given Plug-In Argument List to the current list using addArg().
| plugInArg | Plug-In Argument List whose elements are to be added to the end of this List. |