DataDirector API
Public Member Functions | List of all members
DDD_AttributeBool Class Reference

DataDirector attribute class corresponding to a boolean datatype. More...

#include <DDD_AttributeBool.h>

Inheritance diagram for DDD_AttributeBool:
DDD_AttributeBase

Public Member Functions

 DDD_AttributeBool (const std::string &name, bool initialVal, DDD_AttributeContainer *container, int validConnectionStates, bool persistent, DDD_AttributeBase *revertable)
 
virtual DataType GetPreferredDataType () const
 
virtual std::string GetValueString () const
 
virtual void SetValueString (const std::string &value, bool notify, DDD_AttributeObserver *originator)
 
virtual int GetValueInt (void) const
 
virtual void SetValueInt (const int value, bool notify, DDD_AttributeObserver *originator)
 
virtual unsigned int GetValueUInt (void) const
 
virtual void SetValueUInt (const unsigned int value, bool notify, DDD_AttributeObserver *originator)
 
virtual double GetValueDouble (void) const
 
virtual void SetValueDouble (const double value, bool notify, DDD_AttributeObserver *originator)
 
virtual bool GetValueBool (void) const
 
virtual void SetValueBool (const bool value, bool notify, DDD_AttributeObserver *originator)
 
virtual void SetValueByteBuffer (const char *buffer, unsigned int length, bool notify, DDD_AttributeObserver *originator)
 
virtual void GetValueByteBuffer (char **buffer, unsigned int &length)
 
- Public Member Functions inherited from DDD_AttributeBase
 DDD_AttributeBase (const std::string &name, DDD_AttributeContainer *container, int validConnectionStates, bool persistent, DDD_AttributeBase *revertable)
 
virtual ~DDD_AttributeBase ()
 
bool CanConnectAsInput ()
 
bool CanConnectAsOutput ()
 
int GetValidConnectionStates ()
 
ConnectionState GetConnectionState ()
 
void SetConnectionState (ConnectionState state)
 
void AddConnectionState (ConnectionState state)
 
bool ConnectionStateSupports (ConnectionState state)
 
const char * Name () const
 
DDD_AttributeContainerGetContainer ()
 
void IncreaseRefCount ()
 
void DecreaseRefCount ()
 
int RefCount ()
 
bool AddObserver (DDD_AttributeObserver *observer)
 
bool RemoveObserver (DDD_AttributeObserver *observer)
 
std::string EditorSemantic ()
 
void EditorSemantic (const std::string &semantic)
 
std::string EditorFormatString ()
 
void EditorFormatString (const std::string &formatStr)
 
std::string Connectability ()
 
void SetRevertable (DDD_AttributeBase *attr)
 
DDD_AttributeBaseGetRevertable (void) const
 
void SetPersistent (bool flag)
 
bool IsPersistent (void) const
 
void RevertValue ()
 
void NotifyValueChanged (DDD_AttributeObserver *originator)
 

Additional Inherited Members

- Public Types inherited from DDD_AttributeBase
enum  ConnectionState { NOT_CONNECTED = 0, CONNECTED_INPUT = 1<<1, CONNECTED_OUTPUT = 1<<2, CONNECTED_IN_OUT = (CONNECTED_INPUT | CONNECTED_OUTPUT) }
 
enum  DataType {
  STRING = 0, INT, UINT, DOUBLE,
  BOOLEAN, BYTEBUFFER
}
 
- Static Public Member Functions inherited from DDD_AttributeBase
static const char * DataTypeToString (DataType type)
 
static DataType StringToDataType (const char *string)
 
- Protected Attributes inherited from DDD_AttributeBase
ObserverList _observerList
 
DDD_AttributeContainer_container
 
int _refCount
 
bool _visiting
 
std::string _name
 
ConnectionState _connectionState
 
int _validConnectionStates
 
std::string _editorSemantic
 
std::string _editorFormatString
 
DDD_AttributeBase_revertable
 
bool _persistent
 

Detailed Description

DataDirector attribute class corresponding to a boolean datatype.

Constructor & Destructor Documentation

DDD_AttributeBool ( const std::string &  name,
bool  initialVal,
DDD_AttributeContainer container,
int  validConnectionStates,
bool  persistent,
DDD_AttributeBase revertable 
)

constructor

Parameters
nameThe attribute's name
initialValThe attribute's initial value
containerThe container that will "own" this attribute
validConnectionStatesValid connection states for the attribute (INPUT,OUTPUT, IN_OUT); see DDD_AttributeBase::ConnectionState
persistentTrue if it's a persistent attribute
revertableIf not NULL, it's a pointer to the revertable attribute for this attribute

Member Function Documentation

virtual DataType GetPreferredDataType ( ) const
virtual
Returns
Returns the preferred data type of the attribute
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual bool GetValueBool ( void  ) const
virtual
Returns
Returns the value of this attribute as an boolean
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual void GetValueByteBuffer ( char **  value,
unsigned int &  length 
)
virtual
Returns
Returns the value of this attribute as an byteBuffer
Parameters
valueNewly-allocated buffer returned length of buffer
Note
To avoid leaks, the data returned by value should be deleted when appropriate by the calling module.
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual double GetValueDouble ( void  ) const
virtual
Returns
Returns the value of this attribute as double
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual int GetValueInt ( void  ) const
virtual
Returns
Returns the value of this attribute as an int
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual std::string GetValueString ( ) const
virtual
Returns
Returns the value of this attribute in string format

Implements DDD_AttributeBase.

virtual unsigned int GetValueUInt ( void  ) const
virtual
Returns
Returns the value of this attribute as an unsigned int

Implements DDD_AttributeBase.

virtual void SetValueBool ( const bool  value,
bool  notify,
DDD_AttributeObserver originator 
)
virtual

Sets the value of this attribute using a bool value

Parameters
valueThe new value of the attribute
notifyWhether or not to notify attribute observers
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual void SetValueByteBuffer ( const char *  value,
unsigned int  length,
bool  notify,
DDD_AttributeObserver originator 
)
virtual

Sets the value of this attribute using a byte buffer value

Parameters
valueThe new buffer value of the attribute length of buffer
notifyWhether or not to notify attribute observers
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual void SetValueDouble ( const double  value,
bool  notify,
DDD_AttributeObserver originator 
)
virtual

Sets the value of this attribute using a double value

Parameters
valueThe new value of the attribute
notifyWhether or not to notify attribute observers
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual void SetValueInt ( const int  value,
bool  notify,
DDD_AttributeObserver originator 
)
virtual

Sets the value of this attribute using an int value

Parameters
valueThe new value of the attribute
notifyWhether or not to notify attribute observers
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual void SetValueString ( const std::string &  value,
bool  notify,
DDD_AttributeObserver originator 
)
virtual

Sets the value of this attribute using a string value

Parameters
valueThe new value of the attribute
notifyWhether or not to notify attribute observers
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.

virtual void SetValueUInt ( const unsigned int  value,
bool  notify,
DDD_AttributeObserver originator 
)
virtual

Sets the value of this attribute using an unsigned int value

Parameters
valueThe new value of the attribute
notifyWhether or not to notify attribute observers
Exceptions
DDD_AttributeConversionException

Implements DDD_AttributeBase.


The documentation for this class was generated from the following file: