vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::StaticAttribute< type, tval, tref > Class Template Reference

#include <StaticAttribute.h>

Inheritance diagram for vrecko::StaticAttribute< type, tval, tref >:
vrecko::Attribute

Public Member Functions

 StaticAttribute (const string &strName, const string &strDescription, tref defaultValue, Range *pRange=null)
 
 ~StaticAttribute ()
 
tref getDefaultValue () const
 
const RangegetRangePtr () const
 
bool hasRange () const
 
- Public Member Functions inherited from vrecko::Attribute
const string & getName () const
 
DataType getDataType () const
 
const string & getDescription () const
 
bool isStatic () const
 
bool isDynamic () const
 

Additional Inherited Members

- Public Types inherited from vrecko::Attribute
enum  DataType {
  TYPE_BOOL, TYPE_INT, TYPE_LONG, TYPE_FLOAT,
  TYPE_DOUBLE, TYPE_STRING, TYPE_VEC2, TYPE_VEC3,
  TYPE_VEC4, TYPE_MATRIX, TYPE_QUAT, TYPE_DYNAMIC
}
 
- Protected Member Functions inherited from vrecko::Attribute
 Attribute (const string &strName, DataType dataType, const string &strDescription)
 
 Attribute (const Attribute &attribute)
 

Detailed Description

template<Attribute::DataType type, class tval, class tref = tval>
class vrecko::StaticAttribute< type, tval, tref >

Represents a static attribute.

This class uses templates. Specialized classes are prepared for bool, int, long, float, double, string, Vec2, Vec3, Vec4, Matrix and Quat data types. No other specializations should be used. Specialized classes are listed below this class.

Parameters
dataTypedata type identificator
tvaldata type used to store values
trefdata type used for passing arguments and results
See Also
Attribute
DynamicAttribute
BoolAttribute
IntAttribute
LongAttribute
FloatAttribute
DoubleAttribute
StringAttribute
Vec2Attribute
Vec3Attribute
Vec4Attribute
MatrixAttribute
QuatAttribute

Constructor & Destructor Documentation

template<Attribute::DataType type, class tval , class tref = tval>
vrecko::StaticAttribute< type, tval, tref >::StaticAttribute ( const string &  strName,
const string &  strDescription,
tref  defaultValue,
Range pRange = null 
)
inline

Constructs a StaticAttribute object.

Any pointers passed to this constructor as parameters are used directly, no copy is made. You have to ensure a unique pointer is passed per each call of this constructor. Also ensure that the pointer is used only wihtin the context of this constructor and nowhere else and stays valid all the time. Allocated memory is freed automatically.

Parameters
strNamereference to a constant attribute name
strDescriptionreference to a constant attribute description
defaultValueattribute default value
pRangepointer to a Range object on the heap or null if no range is used
template<Attribute::DataType type, class tval , class tref = tval>
vrecko::StaticAttribute< type, tval, tref >::~StaticAttribute ( )
inline

Performs cleanup before object destruction.

Member Function Documentation

template<Attribute::DataType type, class tval , class tref = tval>
tref vrecko::StaticAttribute< type, tval, tref >::getDefaultValue ( ) const
inline

Returns attribute default value.

Returns
attribute default value
template<Attribute::DataType type, class tval , class tref = tval>
const Range* vrecko::StaticAttribute< type, tval, tref >::getRangePtr ( ) const
inline

Returns attribute range.

Returns
pointer to a constant Range object or null if not set
template<Attribute::DataType type, class tval , class tref = tval>
bool vrecko::StaticAttribute< type, tval, tref >::hasRange ( ) const
inline

"Has range" predicate.

Returns
true if the attribute has a range, false otherwise

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