#include <DataElementGroup.h>

Public Member Functions | |
| virtual bool | insertElement (DataElement *pElement)=0 |
| virtual bool | insertElements (const std::vector< DataElement * > &elements)=0 |
| virtual bool | hasElement (DataElement *pElement) const =0 |
| virtual unsigned int | getNumElements () const =0 |
| virtual const std::vector < DataElement * > & | getElements () const =0 |
| virtual bool | removeElement (DataElement *pElement, bool bDelete=false)=0 |
| virtual bool | removeElements (const std::vector< DataElement * > &elements, bool bDelete=false)=0 |
| virtual void | clear (bool bDelete=false)=0 |
| virtual bool | enforceUniformity (bool enforce)=0 |
| virtual bool | isUniform () const =0 |
Static Public Member Functions | |
| static const std::string & | signalElementDeleted () |
Protected Member Functions | |
| virtual | ~DataElementGroup () |
A data element group stores a list of DataElements. It assumes ownership of the elements added to it, meaning that when the group is destroyed, all elements currently contained in the group will also be destroyed.
If a DataElement that has been added to the group is destroyed via ModelServices, the group will be notified and will remove the element from its internal tracking. This will trigger a notification of a change to the group.
This subclass of Subject will notify upon the following conditions:
Definition at line 37 of file DataElementGroup.h.
| virtual DataElementGroup::~DataElementGroup | ( | ) | [protected, virtual] |
This should be destroyed by calling ModelServices::destroyElement.
Definition at line 203 of file DataElementGroup.h.
| static const std::string& DataElementGroup::signalElementDeleted | ( | ) | [static] |
Emitted with any<DataElement*> when a member element is externally deleted.
Definition at line 43 of file DataElementGroup.h.
| virtual bool DataElementGroup::insertElement | ( | DataElement * | pElement | ) | [pure virtual] |
Adds an element to the group.
It is possible to add the same element to the group multiple times. If uniformity is being enforced and the element is of a different type from the elements already in the group, the method will fail. The method will also fail if pElement is NULL.
| pElement | A pointer to the element to add to the group |
| virtual bool DataElementGroup::insertElements | ( | const std::vector< DataElement * > & | elements | ) | [pure virtual] |
Add several elements to the group.
It is possible to add the same element to the group multiple times.
This method adds several elements to the group. If any of the elements to add are NULL, the method will fail, having done nothing. If uniformity is being enforced and any of the elements to add are of a different type from the elements in the group or each other, the method will fail, having done nothing.
| elements | A vector of elements to add to the group |
| virtual bool DataElementGroup::hasElement | ( | DataElement * | pElement | ) | const [pure virtual] |
Checks to see if an element is in the group.
| pElement | The element to check for. |
| virtual unsigned int DataElementGroup::getNumElements | ( | ) | const [pure virtual] |
Counts the elements in the group.
| virtual const std::vector<DataElement*>& DataElementGroup::getElements | ( | ) | const [pure virtual] |
Gets the list of elements in the group.
The elements are not guaranteed to be in any particular order.
| virtual bool DataElementGroup::removeElement | ( | DataElement * | pElement, | |
| bool | bDelete = false | |||
| ) | [pure virtual] |
Removes an element from the group, optionally deleting it as well.
| pElement | A pointer to the element to remove from the group | |
| bDelete | Specifies if the element should be destroyed as well as being removed from the group. If the element is not found in the group it will not be deleted, regardless of the value of this parameter. |
| virtual bool DataElementGroup::removeElements | ( | const std::vector< DataElement * > & | elements, | |
| bool | bDelete = false | |||
| ) | [pure virtual] |
Removes several elements from the group.
This method removes several elements from the group, optionally deleting them in the process. If the list of elements to remove contains elements not in the group, those elements will be ignored.
| elements | A vector of elements to remove from the group | |
| bDelete | Specifies if the elements should be destroyed as well as being removed from the group. Elements not found in the group will not be deleted regardless of the value of this parameter. |
true if the list of elements to remove was not empty and all of the specified elements were found in the group; otherwise returns false.| virtual void DataElementGroup::clear | ( | bool | bDelete = false |
) | [pure virtual] |
Removes all of the elements from the group.
This method removes all of the elements from the group, optionally deleting them in the process.
| bDelete | Specifies if the elements should be destroyed as well as being removed from the group. |
| virtual bool DataElementGroup::enforceUniformity | ( | bool | enforce | ) | [pure virtual] |
Specifies whether all elements added to a group must be of the same type.
This method specifies whether all elements in a group must be of the same type. If the group already has elements of varying types in it when this method is called to turn on enforcement, it will fail to turn on enforcement. When uniformity is enforced, addElement and addElements will fail to add elements of types different from the type of the elements already in the group. The default for a new DataElementGroup is for enforcement of uniformity to be off.
| enforce | Specifies if enforcement is being turned on or off |
| virtual bool DataElementGroup::isUniform | ( | ) | const [pure virtual] |
Indicates if all of the elements in the group are of the same type.