PlugInArg Class Reference

Containers for individual input and output plug-in parameters. More...

#include <PlugInArg.h>

Inheritance diagram for PlugInArg:

Inheritance graph

List of all members.

Public Member Functions

virtual const std::string & getName () const =0
virtual const std::string & getType () const =0
template<typename T>
T * getPlugInArgValueUnsafe ()
template<typename T>
T * getPlugInArgValue ()
virtual void * getDefaultValue () const =0
virtual bool isDefaultSet () const =0
virtual void * getActualValue () const =0
virtual bool isActualSet () const =0
template<typename T>
bool setPlugInArgValue (T *pValue)
template<typename T>
bool setPlugInArgValueLoose (T *pValue)
virtual void setDefaultValue (const void *pDefValue, bool tryDeepCopy=true)=0
virtual void setActualValue (const void *pValue, bool tryDeepCopy=true)=0
virtual void setName (const std::string &name)=0
virtual bool setType (const std::string &type)=0
virtual void setDescription (const std::string &description)=0
virtual const std::string & getDescription () const =0

Protected Member Functions

virtual ~PlugInArg ()


Detailed Description

Containers for individual input and output plug-in parameters.

Defines the interface that may be used by plug-ins to manipulate their input and output arguments.

See also:
TypeAwareObject, PlugInArgList

Definition at line 26 of file PlugInArg.h.


Constructor & Destructor Documentation

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

This cannot be destroyed directly.

This should be destroyed by destroying the PlugInArgList it belongs to.

See also:
PlugInArgList::~PlugInArgList.

Definition at line 262 of file PlugInArg.h.


Member Function Documentation

virtual const std::string& PlugInArg::getName (  )  const [pure virtual]

Retrieves the plug-in argument name.

Returns:
The argument name.

virtual const std::string& PlugInArg::getType (  )  const [pure virtual]

Retrieves the plug-in argument data type.

Returns:
A string representing the argument data type.

template<typename T>
T* PlugInArg::getPlugInArgValueUnsafe (  ) 

Returns the actual or default value for this plug-in argument.

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, NULL is returned.

Definition at line 56 of file PlugInArg.h.

template<typename T>
T* PlugInArg::getPlugInArgValue (  ) 

Returns the actual or default value for this plug-in argument.

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 type of this argument does not exactly match that provided, NULL is returned.

Definition at line 80 of file PlugInArg.h.

virtual void* PlugInArg::getDefaultValue (  )  const [pure virtual]

Returns the default value for this plug-in argument.

Returns:
A pointer to the default value for this plug-in argument if a default value has been set. Otherwise NULL is returned.

virtual bool PlugInArg::isDefaultSet (  )  const [pure virtual]

Queries whether the default value for the plug-in argument has been set.

Returns:
True if a default value has been set for the argument, otherwise returns false.

virtual void* PlugInArg::getActualValue (  )  const [pure virtual]

Returns the default value for this plug-in argument.

Returns:
A pointer to the actual value for this plug-in argument if the actual value has been set. Otherwise NULL is returned.

virtual bool PlugInArg::isActualSet (  )  const [pure virtual]

Queries whether the actual value for the plug-in argument has been set.

Returns:
True if the actual value has been set for the argument, otherwise returns false.

template<typename T>
bool PlugInArg::setPlugInArgValue ( T *  pValue  ) 

Sets the actual value for this plug-in argument.

The type of the given value must be the same as the arg type.

Parameters:
pValue The actual value of the argument.
Returns:
Returns true if the value is successfully set into the arg. Returns false if type of the given value is not the same as the arg type.
See also:
TypeConverter::toString()

Definition at line 141 of file PlugInArg.h.

template<typename T>
bool PlugInArg::setPlugInArgValueLoose ( T *  pValue  ) 

Sets the actual value for this 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:
pValue The actual value of the argument.
Returns:
Returns true if the value is successfully set into the arg. Returns false if the type of the given value is not a kind of the arg type.
See also:
TypeAwareObject::isKindOf()

Definition at line 169 of file PlugInArg.h.

virtual void PlugInArg::setDefaultValue ( const void *  pDefValue,
bool  tryDeepCopy = true 
) [pure virtual]

Sets the argument's default value.

This method sets the argument's default value to the given value and sets a flag indicating that a default value has been set.

Parameters:
pDefValue A pointer to the default value. The value type must be identical to getType().
tryDeepCopy If true, the PlugInArg will attempt to make a deep copy of the provided value for types that DataVariant can hold. If false or DataVariant cannot hold the given type, the PlugInArg will directly store and hold the provided pDefValue and will not take ownership.

virtual void PlugInArg::setActualValue ( const void *  pValue,
bool  tryDeepCopy = true 
) [pure virtual]

Sets the argument's actual value.

This method sets the argument's actual value to the given value and sets a flag indicating that the actual value has been set.

Parameters:
pValue A pointer to the actual value. The value type must be identical to getType().
tryDeepCopy If true, the PlugInArg will attempt to make a deep copy of the provided value for types that DataVariant can hold. If false or DataVariant cannot hold the given type, the PlugInArg will directly store and hold the provided pValue and will not take ownership.

virtual void PlugInArg::setName ( const std::string &  name  )  [pure virtual]

Sets the argument name.

Parameters:
name A string containing the new argument name, which cannot be empty.

virtual bool PlugInArg::setType ( const std::string &  type  )  [pure virtual]

Sets the argument type.

Parameters:
type A string containing the new argument type.
Returns:
True if the type was successfully set, otherwise false.

virtual void PlugInArg::setDescription ( const std::string &  description  )  [pure virtual]

Set the user-centric description of this argument.

Parameters:
description The description of this argument.

virtual const std::string& PlugInArg::getDescription (  )  const [pure virtual]

Get the user-centric description of this argument.

Returns:
The description of this argument.


Software Development Kit - Opticks 4.9.0 Build 16218