The DDD_AttributeList class. Maintains a list of Data Director attributes.
More...
#include <DDD_AttributeList.h>
|
| DDD_AttributeList () |
|
| ~DDD_AttributeList () |
|
bool | GetValueString (const std::string &name, std::string &returnedValue) |
|
void | Add (DDD_AttributeBase *attr, DDD_AttributeObserver *observer) |
|
DDD_AttributeBase * | Find (const std::string &name) |
|
int | IndexOf (const std::string &name) |
|
void | Remove (const std::string &name) |
|
void | Replace (DDD_AttributeBase *oldAttr, DDD_AttributeBase *newAttr) |
|
void | CopyValues (DDD_AttributeList &attrList, bool notifyObservers=false) |
|
std::string | ToString (const std::string &delim1=";", const std::string &delim2="=") |
|
void | FromString (const std::string &str, const std::string &delim1=";", const std::string &delim2="=") |
|
void | Merge (const DDD_AttributeList &otherList) |
|
void | DeleteDynamicAttributes () |
|
void | RevertAttributes () |
|
unsigned int | Size () const |
|
| DynamicPtrArray (int initialSize=0) |
|
| ~DynamicPtrArray (void) |
|
unsigned int | Count () const |
|
void | InsertObject (const DDD_AttributeBase * &obj, unsigned int loc) |
|
unsigned int | InsertObject (const DDD_AttributeBase * &obj) |
|
void | PushObject (const DDD_AttributeBase * &obj) |
|
void | InsertObjectAfter (const DDD_AttributeBase * &obj, unsigned int loc) |
|
bool | DeleteObject (const DDD_AttributeBase * &obj) |
|
bool | DeleteObjectAtIndex (unsigned int index) |
|
bool | RemoveAndDeallocateObjectAtIndex (unsigned int index) |
|
int | Position (const DDD_AttributeBase * &obj) |
|
bool | RemoveAndDeallocate (DDD_AttributeBase * &obj) |
|
void | Swap (unsigned int a, unsigned int b) |
|
void | EmptyList (void) |
|
void | ClearList (void) |
|
DDD_AttributeBase * & | operator[] (int index) |
|
const DDD_AttributeBase * & | operator[] (int index) const |
|
DDD_AttributeBase * * | InternalArray (void) |
|
DynamicPtrArray< DDD_AttributeBase * > & | operator= (const DynamicPtrArray< DDD_AttributeBase * > &right) |
|
bool | IsEmpty (void) const |
|
The DDD_AttributeList class. Maintains a list of Data Director attributes.
Destructor The DDD_AttributeList does NOT manage the storage of its attributes. Prior to calling this destructor, the calling code should free all of the attributes in this list.
Add an attribute to the list and set its observer
- Parameters
-
attr | The attribute to add |
observer | An observer (or NULL) that will observe the attribute |
Copies the attribute values from the supplied list into this list. Only attributes that exist in both lists will be updated/
- Parameters
-
attrList | A list of attributes |
notifyObservers | If true, the attributes whose values are overwritten will notify their observers |
void DeleteDynamicAttributes |
( |
| ) |
|
Deletes and deallocates all of the attributes in this list that are not marked with the "Persistent" flag
Find the attribute with the given name within this attribute list
- Parameters
-
name | The name of the attribute to find |
- Returns
- A pointer to the attribute or NULL if not found
void FromString |
( |
const std::string & |
str, |
|
|
const std::string & |
delim1 = ";" , |
|
|
const std::string & |
delim2 = "=" |
|
) |
| |
Utility method that converts formatted string into an attribute list NOTE: No trailing delimeter will be expected in the string. NOTE!: This method DOES NOT CHECK FOR DUPLICATE NAMES. IT IS EXPECTED THAT THE CALLER FIRST EMPTY THIS LIST.
- Parameters
-
str | A string containing the attribute list, e.g. "name1=value1;name2=value2" |
delim1 | The delimiter to separate name/value pairs. |
delim2 | The delimiter to sepatate names from values. |
bool GetValueString |
( |
const std::string & |
name, |
|
|
std::string & |
returnedValue |
|
) |
| |
Get the value of the named attribute and return it as a parameter
- Parameters
-
name | The name of the attribute to get |
returnedValue | Will contain the attribute value if found |
- Returns
- True if the attribute was found, false otherwise
int IndexOf |
( |
const std::string & |
name | ) |
|
Get the list index of the attribute with the given name within this attribute list
- Parameters
-
name | The name of the attribute to find |
- Returns
- The (0 based) list index of the attribute or -1 if not found
Merges another attribute list into this one
- Parameters
-
otherList | Another attribute list |
void Remove |
( |
const std::string & |
name | ) |
|
Find the attribute with the given name within this attribute list and remove it
- Parameters
-
name | The name of the attribute to find |
Find the attribute with the given name within this attribute list and replace it
- Parameters
-
name | The name of the attribute to find |
newAttr | The new attribute with which to replace it |
void RevertAttributes |
( |
| ) |
|
Reverts all of the attributes in this list that are marked with the "Revertable" flag
std::string ToString |
( |
const std::string & |
delim1 = ";" , |
|
|
const std::string & |
delim2 = "=" |
|
) |
| |
Utility method that converts an attribute list into a single formatted string using the specified delimiter. NOTE: No trailing delimeter will be added to the string.
- Parameters
-
delim1 | The delimiter to separate name/value pairs. |
delim2 | The delimiter to sepatate names from values. |
- Returns
- A string containing the attribute list, e.g. "name1=value1;name2=value2"
The documentation for this class was generated from the following file: