OpenSim  OpenSim 3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
OpenSim::PropertyDblVec_< M > Class Template Reference

#include <PropertyDblVec.h>

Inheritance diagram for OpenSim::PropertyDblVec_< M >:
OpenSim::Property_Deprecated OpenSim::AbstractProperty

Public Member Functions

 PropertyDblVec_ ()
 Default constructor.
 PropertyDblVec_ (const std::string &aName, const SimTK::Vec< M > &aVec)
 Construct from name and value.
 PropertyDblVec_ (const std::string &aName, const Array< double > &anArray)
 Construct from name and value as an Array<double>
PropertyDblVec_clone () const override
 
Return a new instance of this concrete property object, containing

new copies of this property's values.

std::string getTypeName () const override
 Get the type of this property as a string.
void setValue (const SimTK::Vec< M > &aVec)
 set value of property from an equivalently sized Vec
void setValue (const Array< double > &anArray) override
 set value of this property from an array of doubles of equal or greater length
SimTK::Vec< M > & getValueDblVec ()
 get writable reference to the value
const SimTK::Vec< M > & getValueDblVec () const
 get const (read-only) reference to the value
void setValue (int aSize, const double aArray[]) override
 set value from double array
const Array< double > & getValueDblArray () const override
 get value as double array
Array< double > & getValueDblArray () override
 Nonconst version of accessor for use by GUI.
std::string toString () const override
 Get a constant String represeting the value of this property.
int getArraySize () const override
bool isArrayProperty () const override
 Return true if this is an array property.
int getNumValues () const override
 
How may values are currently stored in this property? If this is an

object property you can use this with getValueAsObject() to iterate over the contained objects.

- Public Member Functions inherited from OpenSim::Property_Deprecated
 Property_Deprecated ()
 Property_Deprecated (PropertyType aType, const std::string &aName)
 Property_Deprecated (const Property_Deprecated &aProperty)
virtual PropertyType getPropertyType () const
 Return the enum value corresponding to the concrete property.
void setMatchName (bool aMatchName)
 
By default deprecated PropertyObj properties will ignore the name

associated with the read-in object.

bool getMatchName () const
 
Return the value of the matchName flag for this (deprecated) 

property.

bool isEqualTo (const AbstractProperty &other) const override
 
The base class equals() method will have already done a lot of checking

prior to calling this method, including verifying that both values are non-default and that the value lists are the same size; the concrete property need only compare the values.

virtual void readFromXMLElement (SimTK::Xml::Element &propertyElement, int versionNumber) override
 
Read in a new value for this property from the XML element 

propertyElement.

virtual void writeToXMLElement (SimTK::Xml::Element &propertyElement) const override
 
Output a serialized representation of this property by writing its

value to the given XML property element.

virtual void clearValues () override
 If the concrete property allows it, clear the value list.
virtual bool isUnnamedProperty () const override
 
An unnamed property is a one-object property whose name was given as

null or as the contained object's type tag.

virtual bool isObjectProperty () const override
 
Return true if this is an "object property", meaning that its values

are all concrete objects of types that ultimately derive from the OpenSim serializable base class Object.

virtual bool isAcceptableObjectTag (const std::string &objectTypeTag) const override
 
Return true if the given string is the XML tag name for one of the

Object-derived types that is allowed by this property.

virtual const ObjectgetValueAsObject (int index=-1) const override
 
For an object property, the values can be obtained as references to

the abstract base class Object from which all the objects derive.

virtual ObjectupdValueAsObject (int index=-1) override
 Get writable access to an existing object value.
virtual void setValueAsObject (const Object &obj, int index=-1) override
 Set the indicated value element to a new copy of the supplied object.
void setNull ()
Property_Deprecatedoperator= (const Property_Deprecated &aProperty)
virtual bool operator== (const Property_Deprecated &aProperty) const
virtual bool operator< (const Property_Deprecated &aProperty) const
void setType (PropertyType aType)
PropertyType getType () const
virtual void setValue (bool aValue)
virtual bool & getValueBool ()
virtual const bool & getValueBool () const
virtual void setValue (int aValue)
virtual int & getValueInt ()
virtual const int & getValueInt () const
virtual void setValue (double aValue)
virtual double & getValueDbl ()
virtual const double & getValueDbl () const
virtual void setValue (const std::string &aValue)
virtual std::string & getValueStr ()
virtual const std::string & getValueStr () const
virtual void setValue (int aSize, const bool aArray[])
virtual void setValue (const Array< bool > &aArray)
virtual Array< bool > & getValueBoolArray ()
virtual const Array< bool > & getValueBoolArray () const
virtual void setValue (int aSize, const int aArray[])
virtual void setValue (const Array< int > &aArray)
virtual Array< int > & getValueIntArray ()
virtual const Array< int > & getValueIntArray () const
virtual void setValue (int aSize, const std::string aArray[])
virtual void setValue (const Array< std::string > &aArray)
virtual Array< std::string > & getValueStrArray ()
virtual const Array
< std::string > & 
getValueStrArray () const
virtual bool isValidObject (const Object *aValue) const
virtual ObjectgetValueObj ()
virtual const ObjectgetValueObj () const
virtual void setValue (Object *aValue)
virtual ObjectgetValueObjPtr ()
virtual ObjectgetValueObjPtr (int index)
virtual void appendValue (Object *obj)
virtual void clearObjArray ()
template<class T >
T & getValue ()
template<class T >
const T & getValue () const
template<class T >
Array< T > & getValueArray ()
template<class T >
const Array< T > & getValueArray () const
- Public Member Functions inherited from OpenSim::AbstractProperty
void setAllowableListSize (int aMin, int aMax)
 
Require that the number of values n in the value list of this property

be in the range aMin <= n <= aMax.

void setAllowableListSize (int aNum)
 
Require that the number of values n in the value list of this property

be exactly n=aNum values.

virtual ~AbstractProperty ()
 Return all heap space used by this property.
bool equals (const AbstractProperty &other) const
 
Compare this property with another one; this is primarily used 

for testing.

bool isSamePropertyClass (const AbstractProperty &other) const
 
Return true if the \a other property is an object of exactly the same 

concrete class as this one.

bool operator== (const AbstractProperty &other) const
 See the equals() method for the meaning of this operator.
void setAllPropertiesUseDefault (bool shouldUseDefault)
 
 This method sets the "use default" flag for this property and the 

properties of any objects it contains to the given value.

void readFromXMLParentElement (SimTK::Xml::Element &parent, int versionNumber)
 
Given an XML parent element expected to contain a value for this

property as an immediate child element, find that property element and set the property value from it.

void writeToXMLParentElement (SimTK::Xml::Element &parent)
 
Given an XML parent element, append a single child element representing

the serialized form of this property.

void setName (const std::string &name)
 Set the property name.
void setComment (const std::string &aComment)
 Set a user-friendly comment to be associated with property.
void setValueIsDefault (bool isDefault)
 
%Set flag indicating whether the value of this property was simply

taken from a default object and thus should not be written out when serializing.

const std::string & getName () const
 Get the property name.
const std::string & getComment () const
 Get the comment associated with this property.
bool getValueIsDefault () const
 
Get the flag indicating whether the current value is just the default

value for this property (in which case it doesn't need to be written out).

int getMinListSize () const
 
Get the minimum number of values allowed in this property's value

list.

int getMaxListSize () const
 
Get the maximum number of values allowed in this property's value

list.

bool isOptionalProperty () const
 
This is an "optional" property if its value list can contain at most

one value.

bool isListProperty () const
 
This is a "list" property if its value list can contain more than

one value.

bool isOneValueProperty () const
 
This is a "one-value" property if its value list must always contain

exactly one value.

bool isOneObjectProperty () const
 
This is a "one-object" property if it is a "one-value" property and

it contains an Object-derived value.

int size () const
 Return the number of values currently in this property's value list.
bool empty () const
 Return true if this property's value list is currently empty.
void clear ()
 
Empty the value list for this property; fails if zero is not an 

allowable size for this property.

template<class T >
const T & getValue (int index=-1) const
 
Return one of the values in this property as type T; this works only 

if the underlying concrete property stores type T and if the indexed element is present, otherwise throws an exception.

template<class T >
T & updValue (int index=-1)
 
Return a writable reference to one of the values in this property as 

type T; this works only if the underlying concrete property is actually of type T and the indexed element is present.

template<class T >
int appendValue (const T &value)
 
Append a new value of type T to the end of the list of values currently

contained in this property.

Additional Inherited Members

- Public Types inherited from OpenSim::Property_Deprecated
enum  PropertyType {
  None = 0, Bool, Int, Dbl,
  Str, Obj, ObjPtr, BoolArray,
  IntArray, DblArray, StrArray, ObjArray,
  DblVec, DblVec3, Transform
}
 Enumeration of recognized types. More...
- Protected Member Functions inherited from OpenSim::AbstractProperty
 AbstractProperty ()
 AbstractProperty (const std::string &name, const std::string &comment)

Constructor & Destructor Documentation

template<int M>
OpenSim::PropertyDblVec_< M >::PropertyDblVec_ ( )
inline

Default constructor.

template<int M>
OpenSim::PropertyDblVec_< M >::PropertyDblVec_ ( const std::string &  aName,
const SimTK::Vec< M > &  aVec 
)
inline

Construct from name and value.

template<int M>
OpenSim::PropertyDblVec_< M >::PropertyDblVec_ ( const std::string &  aName,
const Array< double > &  anArray 
)
inline

Construct from name and value as an Array<double>

Member Function Documentation

template<int M>
PropertyDblVec_* OpenSim::PropertyDblVec_< M >::clone ( ) const
inlineoverridevirtual

Return a new instance of this concrete property object, containing

new copies of this property's values.

The new property object is allocated on the heap and it is up to the caller to delete it when done.

Implements OpenSim::Property_Deprecated.

template<int M>
int OpenSim::PropertyDblVec_< M >::getArraySize ( ) const
inlineoverridevirtual

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
int OpenSim::PropertyDblVec_< M >::getNumValues ( ) const
inlineoverridevirtual

How may values are currently stored in this property? If this is an

object property you can use this with getValueAsObject() to iterate over the contained objects.

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
std::string OpenSim::PropertyDblVec_< M >::getTypeName ( ) const
inlineoverridevirtual

Get the type of this property as a string.

Implements OpenSim::Property_Deprecated.

template<int M>
const Array<double>& OpenSim::PropertyDblVec_< M >::getValueDblArray ( ) const
inlineoverridevirtual

get value as double array

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
Array<double>& OpenSim::PropertyDblVec_< M >::getValueDblArray ( )
inlineoverridevirtual

Nonconst version of accessor for use by GUI.

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
SimTK::Vec<M>& OpenSim::PropertyDblVec_< M >::getValueDblVec ( )
inline

get writable reference to the value

template<int M>
const SimTK::Vec<M>& OpenSim::PropertyDblVec_< M >::getValueDblVec ( ) const
inline

get const (read-only) reference to the value

template<int M>
bool OpenSim::PropertyDblVec_< M >::isArrayProperty ( ) const
inlineoverridevirtual

Return true if this is an array property.

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
void OpenSim::PropertyDblVec_< M >::setValue ( const SimTK::Vec< M > &  aVec)
inline

set value of property from an equivalently sized Vec

template<int M>
void OpenSim::PropertyDblVec_< M >::setValue ( const Array< double > &  anArray)
inlineoverridevirtual

set value of this property from an array of doubles of equal or greater length

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
void OpenSim::PropertyDblVec_< M >::setValue ( int  aSize,
const double  aArray[] 
)
inlineoverridevirtual

set value from double array

Reimplemented from OpenSim::Property_Deprecated.

template<int M>
std::string OpenSim::PropertyDblVec_< M >::toString ( ) const
inlineoverridevirtual

Get a constant String represeting the value of this property.

Implements OpenSim::Property_Deprecated.


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