PlugInArgList Class Reference

All input/output arguments for a plug-in. More...

#include <PlugInArgList.h>

List of all members.

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 ()


Detailed Description

All input/output arguments for a plug-in.

This class is responsible for managing all plug-in arguments that are required for a plug-in argument list.

See also:
PlugInArg
Examples:

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.


Constructor & Destructor Documentation

virtual PlugInArgList::~PlugInArgList (  )  [protected, virtual]

This should be destroyed by calling PlugInManagerServices::destroyPlugInArgList.

Definition at line 371 of file PlugInArgList.h.


Member Function Documentation

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.

template<typename T>
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.

Parameters:
name The name for the argument.
defaultValue The default value for the argument.
description The user-centric description for the argument.
Returns:
True if the operation succeeded, false otherwise.
Examples:
Tutorial/Tutorial1.cpp, Tutorial/Tutorial2.cpp, Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.

Definition at line 53 of file PlugInArgList.h.

template<typename T>
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.

Parameters:
name The name for the argument.
pDefaultValue The default value for the argument as a pointer.
description The user-centric description for the argument.
Returns:
True if the operation succeeded, false otherwise.

Definition at line 85 of file PlugInArgList.h.

template<typename T>
bool PlugInArgList::addArg ( const std::string &  name,
const std::string &  description = std::string() 
)

Add an argument to a PlugInArgList without a default.

Parameters:
name The name for the argument.
description The user-centric description for the argument.
Returns:
True if the operation succeeded, false otherwise.

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.

Parameters:
arg Reference to the Plug-In Argument to be added to the list.
Returns:
The method returns true if the Plug-In Argument was successfully added to the list, otherwise returns false.

template<typename T>
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.

Parameters:
name The name of the plug-in argument to retrive.
Returns:
A pointer to the actual value for this plug-in argument if the actual value has been set. Otherwise the default value is returned if set. If neither is set or the argument is not present in the arg list or the argument type does not match that provided exactly, NULL is returned
Examples:
Tutorial/Tutorial1.cpp, Tutorial/Tutorial2.cpp, Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.

Definition at line 160 of file PlugInArgList.h.

template<typename T>
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.

Parameters:
name The name of the plug-in argument to retrive.
Warning:
This function does not do any type checking. If the type of the argument does not match the template argument, the return value is undefined.
Returns:
A pointer to the actual value for this plug-in argument if the actual value has been set. Otherwise the default value is returned if set. If neither is set or the argument is not present in the arg list, NULL is returned

Definition at line 189 of file PlugInArgList.h.

template<typename T>
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.

Parameters:
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.
Returns:
False if the argument is not present in the arg list or the actual and default argument values are not set, or the type of argument does not exactly match that provided. True if the actual or default value for the argument is set. If the actual or default argument value is a NULL pointer, the output argument will remain unchanged and this function will return true.

Definition at line 221 of file PlugInArgList.h.

template<typename T>
bool PlugInArgList::setPlugInArgValue ( const std::string &  name,
T *  pValue 
)

Sets the actual value for a plug-in argument.

Parameters:
name The name of the plug-in argument for which to set its value.
pValue The actual value of the argument.
Returns:
Returns 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.
See also:
PlugInArg::setPlugInArgValue()
Examples:
Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.

Definition at line 258 of file PlugInArgList.h.

template<typename T>
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.

Parameters:
name The name of the plug-in argument for which to set its value.
pValue The actual value of the argument.
Returns:
Returns 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.
See also:
PlugInArg::setPlugInArgValueLoose()

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.

Parameters:
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.
Returns:
The method returns true if the Plug-In Argument was successfully found in the list, otherwise returns false.

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.

Parameters:
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.
Returns:
The method returns true if the index was a valid index in the list, otherwise returns false.

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().

Returns:
The method returns the number of elements in the Plug-In Argument List, or 0 if none have been added.

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().

Parameters:
plugInArg Plug-In Argument List whose elements are to be added to the end of this List.
Returns:
The method returns true if all items in argList were successfully added to this list, otherwise returns false.


Software Development Kit - Opticks 4.9.0 Build 16218