OpenSim::PropertySet Class Reference

A property set is simply a set of properties. More...

#include <PropertySet.h>

List of all members.

Public Member Functions

 PropertySet ()
 Constructor.
 PropertySet (const PropertySet &aSet)
 Copy constructor.
virtual ~PropertySet ()
bool isEmpty () const
 Implementation of the output operator.
int getSize () const
 Get the number of properties in the set, or, equivalently, the size of the property set.
virtual Propertyget (int i) throw (Exception)
 Get a reference to a property by index.
virtual const Propertyget (int i) const
 Get a constant reference to a property by index.
virtual Propertyget (const std::string &aName) throw (Exception)
virtual const Propertyget (const std::string &aName) const
virtual const Propertycontains (const std::string &aName) const
virtual Propertycontains (const std::string &aName)
virtual void append (Property *aProperty)
 Append a property to the set.
virtual void append (Property *aProperty, const std::string &aName)
virtual void remove (const std::string &aName)
virtual void clear ()
 Clear this property set of all properties and groups.
PropertyGroupaddGroup (std::string aGroupName)
void addPropertyToGroup (std::string aGroupName, std::string aPropertyName)
 Add a property to a group.
void addPropertyToGroup (PropertyGroup *aGroup, std::string aPropertyName)
 Add a property to a group.
void addPropertyToGroup (PropertyGroup *aGroup, Property *aProperty)
 Add a property to a group.
void addPropertyToGroup (std::string aGroupName, Property *aProperty)
 Add a property to a group.
ArrayPtrs< PropertyGroup > & getGroups ()
PropertyGroupgetGroupContaining (Property *aProperty)
 Get the group containing the passed-in property.
int getGroupIndexContaining (Property *aProperty)
 Get the index of the group containing the passed-in property.

Public Attributes

ArrayPtrs< Property_array
 Set of properties.

Protected Attributes

ArrayPtrs< PropertyGroup_propertyGroups
 Array of property groups.

Friends

std::ostream & operator<< (std::ostream &aOut, const PropertySet &aSet)

Detailed Description

A property set is simply a set of properties.

It provides methods for adding, removing, and retrieving properties from itself.

Version:
1.0
Author:
Frank C. Anderson
See also:
Property

Constructor & Destructor Documentation

PropertySet::PropertySet (  ) 

Constructor.

PropertySet::PropertySet ( const PropertySet aSet  ) 

Copy constructor.

Parameters:
aSet Set of properties to be copied.
virtual OpenSim::PropertySet::~PropertySet (  )  [inline, virtual]

Member Function Documentation

PropertyGroup* OpenSim::PropertySet::addGroup ( std::string  aGroupName  ) 
void PropertySet::addPropertyToGroup ( std::string  aGroupName,
Property aProperty 
)

Add a property to a group.

The group will be created if it does not already exist, but the property must already be in the PropertySet for it to be added to the group.

void PropertySet::addPropertyToGroup ( PropertyGroup aGroup,
Property aProperty 
)

Add a property to a group.

The group and the property must already be in the PropertySet.

void PropertySet::addPropertyToGroup ( PropertyGroup aGroup,
std::string  aPropertyName 
)

Add a property to a group.

The group and the property must already be in the PropertySet.

void PropertySet::addPropertyToGroup ( std::string  aGroupName,
std::string  aPropertyName 
)

Add a property to a group.

The group will be created if it does not already exist, but the property must already be in the PropertySet for it to be added to the group.

virtual void OpenSim::PropertySet::append ( Property aProperty,
const std::string &  aName 
) [virtual]
void PropertySet::append ( Property aProperty  )  [virtual]

Append a property to the set.

Parameters:
aProperty Property to be appended. Note that a copy is NOT made.
void PropertySet::clear (  )  [virtual]

Clear this property set of all properties and groups.

virtual Property* OpenSim::PropertySet::contains ( const std::string &  aName  )  [virtual]
virtual const Property* OpenSim::PropertySet::contains ( const std::string &  aName  )  const [virtual]
virtual const Property* OpenSim::PropertySet::get ( const std::string &  aName  )  const [virtual]
virtual Property* OpenSim::PropertySet::get ( const std::string &  aName  )  throw (Exception) [virtual]
const Property * PropertySet::get ( int  aIndex  )  const [virtual]

Get a constant reference to a property by index.

Parameters:
aIndex Index of the property to get.
Exceptions:
Exception if the index is out of bounds.
Property * PropertySet::get ( int  aIndex  )  throw (Exception) [virtual]

Get a reference to a property by index.

Parameters:
aIndex Index of the property to get.
Exceptions:
Exception if the index is out of bounds.
PropertyGroup * PropertySet::getGroupContaining ( Property aProperty  ) 

Get the group containing the passed-in property.

int PropertySet::getGroupIndexContaining ( Property aProperty  ) 

Get the index of the group containing the passed-in property.

ArrayPtrs<PropertyGroup>& OpenSim::PropertySet::getGroups (  )  [inline]
int PropertySet::getSize (  )  const

Get the number of properties in the set, or, equivalently, the size of the property set.

Returns:
Size or number of properties in this set.
bool PropertySet::isEmpty (  )  const

Implementation of the output operator.

Parameters:
aOut Output stream.
aArray Array to be output.
Returns:
Reference to the output stream. ostream& operator<<(ostream &aOut,const PropertySet &aSet) { aOut << "\nProperty Set:\n";

int i; for(i=0;i<aSet.getSize();i++) { aOut << aSet.get(i) << "\n"; }

return(aOut); } Determine whether or not this property set is empty.

Returns:
True if empty; false otherwise.
virtual void OpenSim::PropertySet::remove ( const std::string &  aName  )  [virtual]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  aOut,
const PropertySet aSet 
) [friend]

Member Data Documentation

Set of properties.

Array of property groups.


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

Generated on Sun Sep 25 00:19:51 2011 for OpenSim by  doxygen 1.6.1