Public Types | Public Member Functions | Protected Attributes

FBPropertyBase< tType, pPT > Class Template Reference

Search for all occurrences

Detailed Description

template<class tType, FBPropertyType pPT>
class FBPropertyBase< tType, pPT >

Base template class for all standard properties

Definition at line 603 of file fbproperties.h.

#include <fbproperties.h>

Inheritance diagram for FBPropertyBase< tType, pPT >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef tType ValueType
 Property Value Type.

Public Member Functions

 FBPropertyBase ()
 Constructor.
 FBPropertyBase (const FBPropertyBase< tType, pPT > &pValue)
 Constructor.
 ~FBPropertyBase ()
 Destructor.
FBPropertyBaseInit (void *pParent, const char *pName, tType(*pGet)(void *)=NULL, void(*pSet)(void *, tType)=NULL)
 Initialization function.
 operator tType () const
 Overloaded cast to tType operator.
virtual FBPropertyType GetPropertyType () override
 Get the property's type.
virtual void SetPropertyValue (tType pValue)
 Set the value of the internal property.
tType GetPropertyValue ()
 Get the value of the internal property.
virtual bool IsReadOnly ()
 Is this class read-only? If there is an existing set function, this class is read/write, otherwise it is read-only.
virtual void GetData (void *pData, int pSize, FBEvaluateInfo *pEvalInfo=NULL) const
 Get value.
virtual void SetData (void *pData)
 Set value.
void operator= (tType pValue)
 Overloaded = operator.
void operator= (const FBPropertyBase< tType, pPT > &pProperty)
 Overloaded = operator.

Protected Attributes

void(* Set )(void *, tType)
 Set function pointer.
tType(* Get )(void *)
 Get function pointer.

Member Typedef Documentation

typedef tType ValueType

Property Value Type.

Definition at line 613 of file fbproperties.h.


Constructor & Destructor Documentation

FBPropertyBase ( ) [inline]

Constructor.

Definition at line 616 of file fbproperties.h.

{ Set = NULL; Get = NULL; }  
FBPropertyBase ( const FBPropertyBase< tType, pPT > &  pValue) [inline]

Constructor.

Parameters:
pValueFBPropertyBase.

Definition at line 621 of file fbproperties.h.

{ operator=((tType)pValue ); }
~FBPropertyBase ( ) [inline]

Destructor.

Definition at line 624 of file fbproperties.h.

        {     
        }

Member Function Documentation

FBPropertyBase* Init ( void *  pParent,
const char *  pName,
tType(*)(void *)  pGet = NULL,
void(*)(void *, tType)  pSet = NULL 
) [inline]

Initialization function.

Parameters:
pParentParent object.
pNameName of base enum.
pGetGet function (default=NULL).
pSetSet function (default=NULL).
Returns:
Pointer to this object.

Definition at line 635 of file fbproperties.h.

        {  
            mParent = pParent;  
            mName   = pName ;   
            Get     = pGet;     
            Set     = pSet;     
            return this;
        } 
void operator= ( tType  pValue) [inline]

Overloaded = operator.

Set the value of the current object using the Set function.

Parameters:
pValueValue to set for object.

Reimplemented in FBPropertyBaseEnum< tType >, FBPropertyBaseComponent< tType >, FBPropertyString, FBPropertyBaseComponent< FBPlug * >, and FBPropertyBaseComponent< FBComponent * >.

Definition at line 649 of file fbproperties.h.

{ SetData( &pValue ); }
void operator= ( const FBPropertyBase< tType, pPT > &  pProperty) [inline]

Overloaded = operator.

Set the value of the current object with another property value of the same type.

Parameters:
pPropertyProperty to use to set the value.

Definition at line 657 of file fbproperties.h.

{ operator=((tType)pProperty ); }
operator tType ( ) const [inline]

Overloaded cast to tType operator.

Get the value of the current object using Get fuction.

Returns:
tType cast of current object.

Reimplemented in FBPropertyBaseEnum< tType >, FBPropertyBaseComponent< tType >, FBPropertyBaseComponent< FBPlug * >, FBPropertyBaseComponent< FBComponent * >, and FBPropertyString.

Definition at line 664 of file fbproperties.h.

{ tType Value; GetData( &Value,sizeof(Value) ); return Value; } 
virtual FBPropertyType GetPropertyType ( ) [inline, override, virtual]

Get the property's type.

Returns:
The property's type.

Reimplemented from FBProperty.

Definition at line 669 of file fbproperties.h.

{ return pPT; }
virtual void SetPropertyValue ( tType  pValue) [inline, virtual]

Set the value of the internal property.

Parameters:
pValueValue to set to internal property.

Reimplemented in FBPropertyString.

Definition at line 674 of file fbproperties.h.

        {
            if(IsInternal() && GetValuePtr())
            {
                *(tType*)GetValuePtr() = pValue;
            }
        }
tType GetPropertyValue ( ) [inline]

Get the value of the internal property.

Returns:
Property value.

Definition at line 685 of file fbproperties.h.

        {
            if(IsInternal() && GetValuePtr())
            {
                return *(tType*)GetValuePtr();
            } else
            {
                return (tType)0;
            }
        }
virtual bool IsReadOnly ( ) [inline, virtual]

Is this class read-only? If there is an existing set function, this class is read/write, otherwise it is read-only.

Returns:
true if it is read-only.

Reimplemented from FBProperty.

Definition at line 700 of file fbproperties.h.

{ return IsInternal() ? (FBProperty::IsReadOnly()) : (Set == NULL); }
virtual void GetData ( void *  pData,
int  pSize,
FBEvaluateInfo pEvalInfo = NULL 
) const [inline, virtual]

Get value.

Return values:
pValueValue to fill with current object value.

Reimplemented from FBProperty.

Definition at line 705 of file fbproperties.h.

        {
            if(Get)
            { 
                *((tType*)pData) = (*Get)(mParent); 
            } 
            else if (IsInternal())
            {
                FBProperty::GetData( pData, pSize, pEvalInfo );
            } 
            else
            {
                assert(Get != NULL || IsInternal());
                *((tType*)pData) = (tType)0; 
            }
        }
virtual void SetData ( void *  pData) [inline, virtual]

Set value.

Parameters:
pDataInteger to use to set.

Reimplemented from FBProperty.

Definition at line 724 of file fbproperties.h.

        { 
            if(Set) 
            { 
                (*Set)( mParent,*(tType*)pData ); 
            } 
            else if (IsInternal())
            {
                FBProperty::SetData( pData );
            } 
            else
            { 
                assert( Set != NULL || IsInternal() ); 
            } 
        } 

Member Data Documentation

void(* Set)(void *, tType) [protected]

Set function pointer.

Definition at line 607 of file fbproperties.h.

tType(* Get)(void *) [protected]

Get function pointer.

Definition at line 608 of file fbproperties.h.


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