|
DataDirector API
|
A virtual interface class for all DataDirector attribute types. More...
#include <DDD_AttributeBase.h>
Public Types | |
| 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 } |
Public Member Functions | |
| 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_AttributeContainer * | GetContainer () |
| void | IncreaseRefCount () |
| void | DecreaseRefCount () |
| int | RefCount () |
| virtual std::string | GetValueString () const =0 |
| virtual void | SetValueString (const std::string &value, bool notify, DDD_AttributeObserver *originator)=0 |
| virtual int | GetValueInt (void) const =0 |
| virtual void | SetValueInt (const int value, bool notify, DDD_AttributeObserver *originator)=0 |
| virtual unsigned int | GetValueUInt (void) const =0 |
| virtual void | SetValueUInt (const unsigned int value, bool notify, DDD_AttributeObserver *originator)=0 |
| virtual double | GetValueDouble (void) const =0 |
| virtual void | SetValueDouble (const double value, bool notify, DDD_AttributeObserver *originator)=0 |
| virtual bool | GetValueBool (void) const =0 |
| virtual void | SetValueBool (const bool value, bool notify, DDD_AttributeObserver *originator)=0 |
| virtual void | GetValueByteBuffer (char **value, unsigned int &length)=0 |
| virtual void | SetValueByteBuffer (const char *value, unsigned int length, bool notify, DDD_AttributeObserver *originator)=0 |
| virtual DataType | GetPreferredDataType () const =0 |
| 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_AttributeBase * | GetRevertable (void) const |
| void | SetPersistent (bool flag) |
| bool | IsPersistent (void) const |
| void | RevertValue () |
| void | NotifyValueChanged (DDD_AttributeObserver *originator) |
Static Public Member Functions | |
| static const char * | DataTypeToString (DataType type) |
| static DataType | StringToDataType (const char *string) |
Protected Attributes | |
| 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 |
A virtual interface class for all DataDirector attribute types.
| enum ConnectionState |
The ConnectionState enum is used both to describe the current connection state of an attribute and the allowable/valid connectablity states of the attribute
| enum DataType |
The DataType enum describes the base data type used by an attribute. Its main purpose is to facilitate efficient typed access to attribute data
| DDD_AttributeBase | ( | const std::string & | name, |
| DDD_AttributeContainer * | container, | ||
| int | validConnectionStates, | ||
| bool | persistent, | ||
| DDD_AttributeBase * | revertable | ||
| ) |
constructor
| name | The instance name of the attribute |
| container | The container that will own the attribute |
| validConnectionStates | The allowable connection states for the attribute (i.e. how can it be connected?) |
| persistent | True if it's a persistent attribute |
| revertable | If not NULL, it's a pointer to the revertable attribute for this attribute |
|
virtual |
destructor
| void AddConnectionState | ( | ConnectionState | state | ) |
Adds the state to the connectability mask for this attribute
| state | The connection state to set |
| bool AddObserver | ( | DDD_AttributeObserver * | observer | ) |
Adds an observer to this attribute that will be notified whenever this attribute changes
| observer | The observer to add. The observer to add must not already be observing this attribute. |
|
inline |
|
inline |
| std::string Connectability | ( | ) |
the connectability status of the attribute as a string
| bool ConnectionStateSupports | ( | ConnectionState | state | ) |
| state | Type of connection to check for (CONNECTED_INPUT, CONNECTED_OUTPUT) |
|
static |
| type | The data type enum |
| void DecreaseRefCount | ( | ) |
Decreases the Reference count of this attribute. The Reference Count tracks the number of connections that reference the attribute.
| std::string EditorFormatString | ( | ) |
| void EditorFormatString | ( | const std::string & | formatStr | ) |
Sets the printf style format string which the editor may use when editing this attribute
| formatStr | The format string to set |
| std::string EditorSemantic | ( | ) |
| void EditorSemantic | ( | const std::string & | semantic | ) |
Sets the "EditorSemantic" which suggests to the editor what type of widget to use when editing this attribute.
| semantic | The string to set |
| ConnectionState GetConnectionState | ( | ) |
| DDD_AttributeContainer* GetContainer | ( | ) |
|
pure virtual |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
inline |
|
inline |
|
pure virtual |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
| value | Newly-allocated buffer returned length of buffer |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
| void IncreaseRefCount | ( | ) |
Increases the Reference count of this attribute. The Reference Count tracks the number of connections that reference the attribute.
|
inline |
| const char* Name | ( | ) | const |
| void NotifyValueChanged | ( | DDD_AttributeObserver * | originator | ) |
Notifies all observers of this attribute that the value has changed
| int RefCount | ( | ) |
| bool RemoveObserver | ( | DDD_AttributeObserver * | observer | ) |
Removes an observer from the observer list
| observer | The observer to remove. |
| void RevertValue | ( | ) |
Causes this attribute to "revert" to it's revert value
| void SetConnectionState | ( | ConnectionState | state | ) |
Sets the current connection state of the attribute
| state | The connection state to set |
|
inline |
Sets the "persistent" flag for this attribute. Persistent attributes are not deleted by the "DeleteDynamicAttributes" method of DDD_AttributeList
| flag | New persistent flag |
|
inline |
Sets the "revertable" attribute for this attribute. Revertable attributes are "reverted" to an initial value whenever the Data Director is Resumed()
| flag | New revertable flag |
|
pure virtual |
Sets the value of this attribute using a bool value
| value | The new value of the attribute |
| notify | Whether or not to notify attribute observers |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Sets the value of this attribute using a byte buffer value
| value | The new buffer value of the attribute length of buffer |
| notify | Whether or not to notify attribute observers |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Sets the value of this attribute using a double value
| value | The new value of the attribute |
| notify | Whether or not to notify attribute observers |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Sets the value of this attribute using an int value
| value | The new value of the attribute |
| notify | Whether or not to notify attribute observers |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Sets the value of this attribute using a string value
| value | The new value of the attribute |
| notify | Whether or not to notify attribute observers |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
pure virtual |
Sets the value of this attribute using an unsigned int value
| value | The new value of the attribute |
| notify | Whether or not to notify attribute observers |
| DDD_AttributeConversionException |
Implemented in DDD_AttributeByteBuffer, DDD_AttributeString, DDD_AttributeUInt, DDD_AttributeBool, DDD_AttributeDouble, and DDD_AttributeInt.
|
static |
| string | The data type as a string |
|
protected |
The current connection state of this attribute
|
protected |
The container that owns this attribute
|
protected |
printf style format string to use in the editor
|
protected |
String defining what type of widget to use in the editor
|
protected |
The instance name of this attribute
|
protected |
The list of observers to notify when this attribute changes
|
protected |
True if the attribute is a "Persistent" attribute.
|
protected |
The number of connections that reference this attribute
|
protected |
If the attribute is a "Revertable" attribute, pointer to attribute to revert to
|
protected |
The valid connectability states possible for this attribute
|
protected |
True while attribute is being visited...prevents loops
1.8.10