dtDAL::GenericActorProperty< SetType, GetType > Class Template Reference

The GenericActorProperty class implements the set and get functionality which defines the primary behavior of the ActorProperty. More...

#include <genericactorproperty.h>

Inheritance diagram for dtDAL::GenericActorProperty< SetType, GetType >:

dtDAL::ActorProperty dtDAL::AbstractParameter dtDAL::GameEventActorProperty

List of all members.

Public Member Functions

 GenericActorProperty (DataType &dataType, const std::string &name, const std::string &label, Functor1< SetType > &set, Functor0Ret< GetType > &get, const std::string &desc, const std::string &groupName, bool readOnly=false)
 Constructs the actor property.
virtual void CopyFrom (const ActorProperty &otherProp)
 This method allows a generic property of any type to be copied from one to the other.
void SetValue (SetType value)
 Sets the value of this property by calling the set functor assigned to this property.
GetType GetValue () const
 
Returns:
the value of this property be calling the get functor assigned to this property.


Protected Member Functions

virtual ~GenericActorProperty ()
 Keep destructors protected to ensure property smart pointer management.


Detailed Description

template<class SetType, class GetType>
class dtDAL::GenericActorProperty< SetType, GetType >

The GenericActorProperty class implements the set and get functionality which defines the primary behavior of the ActorProperty.

The class is templated such that it has a set type and a get type which correspond to the set and get method signatures.

Note:
The set method signature excepts one parameter of any type and may or may not return a value.

The get method returns a value of any type and takes no parameters.


Constructor & Destructor Documentation

template<class SetType, class GetType>
dtDAL::GenericActorProperty< SetType, GetType >::GenericActorProperty ( DataType dataType,
const std::string &  name,
const std::string &  label,
Functor1< SetType > &  set,
Functor0Ret< GetType > &  get,
const std::string &  desc,
const std::string &  groupName,
bool  readOnly = false 
) [inline]

Constructs the actor property.

Note, that functor objects must be specified and match the set and get types of the GenericActorProperty.

template<class SetType, class GetType>
virtual dtDAL::GenericActorProperty< SetType, GetType >::~GenericActorProperty (  )  [inline, protected, virtual]

Keep destructors protected to ensure property smart pointer management.


Member Function Documentation

template<class SetType, class GetType>
virtual void dtDAL::GenericActorProperty< SetType, GetType >::CopyFrom ( const ActorProperty otherProp  )  [inline, virtual]

This method allows a generic property of any type to be copied from one to the other.

Parameters:
otherProp The property to copy from.
Note:
This method will only allow generic properties of the same type to be copied. For example, a FloatActorProperty cannot be copied to an IntActorProperty.

Implements dtDAL::ActorProperty.

template<class SetType, class GetType>
void dtDAL::GenericActorProperty< SetType, GetType >::SetValue ( SetType  value  )  [inline]

Sets the value of this property by calling the set functor assigned to this property.

Reimplemented in dtDAL::StringActorProperty.

template<class SetType, class GetType>
GetType dtDAL::GenericActorProperty< SetType, GetType >::GetValue (  )  const [inline]

Returns:
the value of this property be calling the get functor assigned to this property.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008