![]() |
VR-Link API Documentation for DIS
|
A Flyweight class for manipulating objects and their hierarchy The DtEnvironment wraps a DtEnvValuSP value and provides common queries, algorithms, and operations for the hierarchy. More...
Collaboration diagram for DtEnvironment:Public Member Functions | |
| DtEnvironment () | |
| Constructor, that creates a default named list called "root". | |
| DtEnvironment (const DtString &name) | |
| Constructor, that creates an named environment. | |
| DtEnvironment (DtEnvValueSP root) | |
| Constructor, that uses an existing object as its root. | |
| virtual | ~DtEnvironment () |
| Destructor. | |
| void | sync () |
| Synchronize environment Synchronize all objects with their DtEnvObjectSync sync object. | |
| void | sync (DtEnvValueSP value) |
| Synchronize the value and all its sub-objects with their DtEnvObjectSync sync object. | |
| DtEnvValueSP | root () const |
| Get accessor for the environment's root object. | |
| void | setRoot (DtEnvValueSP root) |
| Set accessor for the environment's root object. | |
| void | rootToParent () |
| Moves the root up one level. | |
| DtEnvValueSP | getTopParent () |
| Returns the top parent of the root, object WILL not be in environment, or will be root. | |
| DtEnvValueSP | getTopParent (DtEnvValueSP value) |
| Returns the top parent of the value, object MAY not be in environment. | |
| void | reparent (DtEnvValueSP value, DtEnvValueSP parent) |
| Moves a child value from its current location to a new location. | |
| DtEnvValueSP | addNativeValue (DtNativeValueSP nativeValue, DtEnvValueSP parent) |
| DtEnvValueSP | getNativeValue (DtEnvValueSP parent) const |
| DtEnvValueSP | addAttribute (const DtString &name, const DtString &value) |
| DtEnvValueSP | addAttribute (const DtString &name, const DtString &value, DtEnvValueSP parent) |
| DtEnvValueSP | addNamedList (const DtString &name) |
| DtEnvValueSP | addNamedList (const DtString &name, DtEnvValueSP parent) |
| DtEnvValueSP | getAttribute (const DtString &name) |
| DtEnvValueSP | getAttribute (const DtString &name, DtEnvValueSP parent) |
| void | getNamedListsByName (const DtString &objectName, std::list< DtEnvValueSP > &list) |
| void | getObjectsByName (const DtString &objectName, std::list< DtEnvValueSP > &list) |
| void | getObjectsByType (const DtString &objectType, std::list< DtEnvValueSP > &list) |
| void | getNamedListsByName (const DtString &objectName, std::list< DtEnvValueSP > &list, DtEnvValueSP parent) |
| void | getObjectsByName (const DtString &objectName, std::list< DtEnvValueSP > &list, DtEnvValueSP parent) |
| void | getObjectsByType (const DtString &objectType, std::list< DtEnvValueSP > &list, DtEnvValueSP parent) |
| DtEnvValueSP | getNamedList (const DtString &name) const |
| DtEnvValueSP | getNamedList (const DtString &name, DtEnvValueSP root) const |
| DtEnvValueSP | getObject (const DtString &name, const DtString &type) const |
| Lookup an object based on it's name and type. | |
| DtEnvValueSP | getObject (const DtString &name, const DtString &type, DtEnvValueSP root) const |
| DtEnvObjectSync * | getObjectSync (const DtString &name, const DtString &type) const |
| Lookup an object and return its sync object. | |
| DtEnvObjectSync * | getObjectSync (const DtString &name, const DtString &type, DtEnvValueSP root) const |
| Lookup an object and return its sync object. | |
| DtEnvValueSP | copy (DtEnvValueSP original) |
| Create a copy an object into the environment. | |
| DtEnvValueSP | copy (DtEnvValueSP original, DtEnvValueSP parent) |
| Create copy an object and add it to the specified parent; Copy duplicates the value and any attributes or sub-objects. | |
| void | remove (DtEnvValueSP value) |
| Remove an object from the environment. | |
| bool | contains (DtEnvValueSP value) |
| The function determines if the value is in the current environment Follows the values parent to see if it matches the environment root. | |
| int | level (DtEnvValueSP value) |
| The function calculates the level of the value in the environment. | |
| void | print (std::ostream &output, const DtString &indent, bool printComments=true) const |
| The function prints the environment to the output stream. | |
| void | print (std::ostream &output, DtEnvValueSP root, const DtString &indent, bool printComments=true) const |
| The function prints the environment to the output stream. | |
| DtEnvValueSP | addComment (const DtString &comment, DtEnvValueSP parent) |
| Adds a comment to the object. | |
| DtEnvValueSP | addComment (const DtString &comment) |
| Adds a comment to the object. | |
| DtEnvValueSP | addObject (const DtString &objectType) |
| Add an object to the environment. | |
| DtEnvValueSP | addObject (const DtString &objectType, DtEnvValueSP parent) |
| Add an object to the environment. | |
| DtEnvValueSP | addObject (const DtString &objectName, const DtString &objectType) |
| Add an object to the environment. | |
| DtEnvValueSP | addObject (const DtString &objectName, const DtString &objectType, DtEnvValueSP parent) |
| Add an object to the environment. | |
Protected Attributes | |
| DtEnvValueSP | myRoot |
| The root of the environment. | |
A Flyweight class for manipulating objects and their hierarchy The DtEnvironment wraps a DtEnvValuSP value and provides common queries, algorithms, and operations for the hierarchy.
Constructor, that creates a default named list called "root".
| DtEnvironment::DtEnvironment | ( | const DtString & | name | ) | [explicit] |
Constructor, that creates an named environment.
| DtEnvironment::DtEnvironment | ( | DtEnvValueSP | root | ) | [explicit] |
Constructor, that uses an existing object as its root.
| Input | |
| root | An existing value to be used as the |
| virtual DtEnvironment::~DtEnvironment | ( | ) | [virtual] |
Destructor.
| DtEnvValueSP DtEnvironment::addAttribute | ( | const DtString & | name, |
| const DtString & | value | ||
| ) |
| DtEnvValueSP DtEnvironment::addAttribute | ( | const DtString & | name, |
| const DtString & | value, | ||
| DtEnvValueSP | parent | ||
| ) |
| DtEnvValueSP DtEnvironment::addComment | ( | const DtString & | comment, |
| DtEnvValueSP | parent | ||
| ) |
Adds a comment to the object.
| Input | |
| comment | A string that is a comment of the parent. |
| parent | The value the comment is added to. |
| DtEnvValueSP DtEnvironment::addComment | ( | const DtString & | comment | ) |
Adds a comment to the object.
| Input | |
| comment | A string that is a comment of the parent. |
| parent | The value the comment is added to. |
| DtEnvValueSP DtEnvironment::addNamedList | ( | const DtString & | name | ) |
| DtEnvValueSP DtEnvironment::addNamedList | ( | const DtString & | name, |
| DtEnvValueSP | parent | ||
| ) |
| DtEnvValueSP DtEnvironment::addNativeValue | ( | DtNativeValueSP | nativeValue, |
| DtEnvValueSP | parent | ||
| ) |
| DtEnvValueSP DtEnvironment::addObject | ( | const DtString & | objectType | ) |
Add an object to the environment.
Input
| objectType | The type of object to add. |
| parent | The parent of the object to add. |
| objectName | The name of the object to add. |
| DtEnvValueSP DtEnvironment::addObject | ( | const DtString & | objectType, |
| DtEnvValueSP | parent | ||
| ) |
Add an object to the environment.
Input
| objectType | The type of object to add. |
| parent | The parent of the object to add. |
| objectName | The name of the object to add. |
| DtEnvValueSP DtEnvironment::addObject | ( | const DtString & | objectName, |
| const DtString & | objectType | ||
| ) |
Add an object to the environment.
Input
| objectType | The type of object to add. |
| parent | The parent of the object to add. |
| objectName | The name of the object to add. |
| DtEnvValueSP DtEnvironment::addObject | ( | const DtString & | objectName, |
| const DtString & | objectType, | ||
| DtEnvValueSP | parent | ||
| ) |
Add an object to the environment.
Input
| objectType | The type of object to add. |
| parent | The parent of the object to add. |
| objectName | The name of the object to add. |
| bool DtEnvironment::contains | ( | DtEnvValueSP | value | ) |
The function determines if the value is in the current environment Follows the values parent to see if it matches the environment root.
| Input | |
| value | The value to check. |
| true | The Value was in the environment. |
| false | The Value was NOT in the environment. |
| DtEnvValueSP DtEnvironment::copy | ( | DtEnvValueSP | original | ) |
Create a copy an object into the environment.
Copy duplicates the value and any attributes or sub-objects. The copy is added to the environment's root. All duplicated objects are unbound, regardless of whether the original was bound to a sync object.
| Input | |
| original | The original object to be copied, it will not be modified. |
| 0 | A copy was unable to be created. |
| DtEnvValueSP DtEnvironment::copy | ( | DtEnvValueSP | original, |
| DtEnvValueSP | parent | ||
| ) |
Create copy an object and add it to the specified parent; Copy duplicates the value and any attributes or sub-objects.
The copy is added to the supplied parent. All duplicated objects are unbound, regardless of whether the original was bound to a sync object.
| Input | |
| original | The original object to be copied, it will not be modified |
| parent | The parent object which the copy will be added to. |
| 0 | A copy was unable to be created. |
| DtEnvValueSP DtEnvironment::getAttribute | ( | const DtString & | name | ) |
| DtEnvValueSP DtEnvironment::getAttribute | ( | const DtString & | name, |
| DtEnvValueSP | parent | ||
| ) |
| DtEnvValueSP DtEnvironment::getNamedList | ( | const DtString & | name | ) | const |
| DtEnvValueSP DtEnvironment::getNamedList | ( | const DtString & | name, |
| DtEnvValueSP | root | ||
| ) | const |
| void DtEnvironment::getNamedListsByName | ( | const DtString & | objectName, |
| std::list< DtEnvValueSP > & | list | ||
| ) |
| void DtEnvironment::getNamedListsByName | ( | const DtString & | objectName, |
| std::list< DtEnvValueSP > & | list, | ||
| DtEnvValueSP | parent | ||
| ) |
| DtEnvValueSP DtEnvironment::getNativeValue | ( | DtEnvValueSP | parent | ) | const |
| DtEnvValueSP DtEnvironment::getObject | ( | const DtString & | name, |
| const DtString & | type | ||
| ) | const |
Lookup an object based on it's name and type.
| DtEnvValueSP DtEnvironment::getObject | ( | const DtString & | name, |
| const DtString & | type, | ||
| DtEnvValueSP | root | ||
| ) | const |
| void DtEnvironment::getObjectsByName | ( | const DtString & | objectName, |
| std::list< DtEnvValueSP > & | list | ||
| ) |
| void DtEnvironment::getObjectsByName | ( | const DtString & | objectName, |
| std::list< DtEnvValueSP > & | list, | ||
| DtEnvValueSP | parent | ||
| ) |
| void DtEnvironment::getObjectsByType | ( | const DtString & | objectType, |
| std::list< DtEnvValueSP > & | list | ||
| ) |
| void DtEnvironment::getObjectsByType | ( | const DtString & | objectType, |
| std::list< DtEnvValueSP > & | list, | ||
| DtEnvValueSP | parent | ||
| ) |
| DtEnvObjectSync* DtEnvironment::getObjectSync | ( | const DtString & | name, |
| const DtString & | type | ||
| ) | const |
Lookup an object and return its sync object.
return Returns a pointer to an DtEnvObjectSync object. retval 0 Either the object does not exist, or the object does not have a sync object.
| DtEnvObjectSync* DtEnvironment::getObjectSync | ( | const DtString & | name, |
| const DtString & | type, | ||
| DtEnvValueSP | root | ||
| ) | const |
Lookup an object and return its sync object.
return Returns a pointer to an DtEnvObjectSync object. retval 0 Either the object does not exist, or the object does not have a sync object.
Returns the top parent of the root, object WILL not be in environment, or will be root.
Returns the top parent of the value, object MAY not be in environment.
| int DtEnvironment::level | ( | DtEnvValueSP | value | ) |
The function calculates the level of the value in the environment.
Follows the values to the parent and counts the number of parents until the environment's root.
| Input | |
| value | The value to check. |
| 0 | The value is the environment root. |
| 1 | The value is the child of the environment root. |
| 2 | The value is the grandchild of the root. |
| -1 | The value is not in the environment. |
| void DtEnvironment::print | ( | std::ostream & | output, |
| const DtString & | indent, | ||
| bool | printComments = true |
||
| ) | const |
The function prints the environment to the output stream.
| void DtEnvironment::print | ( | std::ostream & | output, |
| DtEnvValueSP | root, | ||
| const DtString & | indent, | ||
| bool | printComments = true |
||
| ) | const |
The function prints the environment to the output stream.
| void DtEnvironment::remove | ( | DtEnvValueSP | value | ) |
Remove an object from the environment.
Removes the value from it's parent. If no additional references to the value exist, it will be deallocated.
| Input | |
| original | The original object to be removed. |
| void DtEnvironment::reparent | ( | DtEnvValueSP | value, |
| DtEnvValueSP | parent | ||
| ) |
Moves a child value from its current location to a new location.
| value | The value to reparent. |
| parent | The value's new parent |
| DtEnvValueSP DtEnvironment::root | ( | ) | const |
Get accessor for the environment's root object.
| void DtEnvironment::rootToParent | ( | ) |
Moves the root up one level.
If the root is already a top root, the function does not modify the root.
| void DtEnvironment::setRoot | ( | DtEnvValueSP | root | ) |
Set accessor for the environment's root object.
Changes the root of the environment. Equivalent of constructing an new environment with the root.
| void DtEnvironment::sync | ( | ) |
Synchronize environment Synchronize all objects with their DtEnvObjectSync sync object.
Potentially slow due to large amounts of serialization to strings.
| void DtEnvironment::sync | ( | DtEnvValueSP | value | ) |
Synchronize the value and all its sub-objects with their DtEnvObjectSync sync object.
Potentially slow due to large amounts of serialization to strings.
| Input | |
| value | The value to sync. |
DtEnvValueSP DtEnvironment::myRoot [protected] |
The root of the environment.