eproperty::PropertyType< TYPE > Class Template Referenceabstract

#include <PropertyType.hpp>

Inheritance diagram for eproperty::PropertyType< TYPE >:
eproperty::Property eproperty::List< TYPE > eproperty::Value< TYPE > eproperty::Range< TYPE >

Public Member Functions

template<class CLASS_TYPE >
 PropertyType (CLASS_TYPE *_owner, const std::string &_name, const TYPE &_defaultValue, const std::string &_description="", void(CLASS_TYPE::*_setObs)()=nullptr)
 
 PropertyType (const TYPE &_defaultValue)
 
virtual ~PropertyType ()=default
 
std::string getPropertyType () const override
 
std::string getType () const override
 
std::string getString () const override
 
std::string getDefault () const override
 
std::string getInfo () const override
 
bool isDefault () const override
 
void setDefault () override
 
virtual void changeDefault (const TYPE &_newDefault)
 
const TYPE & get () const
 
virtual void set (const TYPE &_newVal)
 
void setDirect (const TYPE &_newVal)
 
virtual void setDirectCheck (const TYPE &_newVal)
 
TYPE & getDirect ()
 
virtual std::string getValueSpecific (const TYPE &_valueRequested) const =0
 
 operator const TYPE & () const
 
const TYPE & operator* () const noexcept
 
const TYPE * operator-> () const noexcept
 
PropertyType< TYPE > & operator= (const TYPE &_newVal)=delete
 
- Public Member Functions inherited from eproperty::Property
 Property (eproperty::Interface *_paramInterfaceLink, const std::string &_name)
 
 Property ()
 
virtual ~Property ()=default
 
void notifyChange () const
 
virtual std::string getName () const
 
virtual void setString (const std::string &_newVal)=0
 
virtual std::vector< std::string > getListValue () const
 
template<class TYPE >
bool operator== (const TYPE &_obj) const =delete
 
template<class TYPE >
bool operator!= (const TYPE &_obj) const =delete
 
template<class TYPE >
bool operator<= (const TYPE &_obj) const =delete
 
template<class TYPE >
bool operator>= (const TYPE &_obj) const =delete
 
template<class TYPE >
bool operator< (const TYPE &_obj) const =delete
 
template<class TYPE >
bool operator> (const TYPE &_obj) const =delete
 

Protected Attributes

TYPE m_value
 
TYPE m_default
 

Additional Inherited Members

- Public Types inherited from eproperty::Property
using Observer = std::function< void()>
 
- Protected Member Functions inherited from eproperty::Property
void setObserver (eproperty::Property::Observer _setObs)
 

Detailed Description

template<class TYPE>
class eproperty::PropertyType< TYPE >

Template base of the property (have a generic set and get for string)

Constructor & Destructor Documentation

§ PropertyType() [1/2]

template<class TYPE >
template<class CLASS_TYPE >
eproperty::PropertyType< TYPE >::PropertyType ( CLASS_TYPE *  _owner,
const std::string &  _name,
const TYPE &  _defaultValue,
const std::string &  _description = "",
void(CLASS_TYPE::*)()  _setObs = nullptr 
)
inline

Create a parameter with a specific type.

Parameters
[in]_ownerOwner of the parameter (nullptr if none).
[in]_nameStatic name of the parameter.
[in]_defaultValueDefault value of the parameter.
[in]_descriptiondescription of the parameter.
[in]_setObsfunction of the class that opserve the change of the value

§ PropertyType() [2/2]

template<class TYPE >
eproperty::PropertyType< TYPE >::PropertyType ( const TYPE &  _defaultValue)
inline

Create a parameter with a specific type.

Parameters
[in]_defaultValueDefault value of the parameter.

§ ~PropertyType()

template<class TYPE >
virtual eproperty::PropertyType< TYPE >::~PropertyType ( )
virtualdefault

Destructor.

Member Function Documentation

§ changeDefault()

template<class TYPE >
virtual void eproperty::PropertyType< TYPE >::changeDefault ( const TYPE &  _newDefault)
inlinevirtual

Set new default value on the property.

Parameters
[in]_newDefaultNew value to set

§ get()

template<class TYPE >
const TYPE& eproperty::PropertyType< TYPE >::get ( ) const
inline

Get the value of the current parameter.

Note
For performence, this function must be inline
Returns
the Reference value

§ getDefault()

template<class TYPE >
std::string eproperty::PropertyType< TYPE >::getDefault ( ) const
inlineoverridevirtual

Get the string of the default value of the Property.

Returns
the string decription of the default value.

Implements eproperty::Property.

§ getDirect()

template<class TYPE >
TYPE& eproperty::PropertyType< TYPE >::getDirect ( )
inline

Get the value of the current parameter (no check (for internal set with no check).

Note
For performence, this function must be inline
Only use by the owner of the property (can not be check on compile time for now ...) TODO: Do it better ... compile check
Returns
a reference on the value

§ getInfo()

template<class TYPE >
std::string eproperty::PropertyType< TYPE >::getInfo ( ) const
inlineoverridevirtual

Description of the Propertys.

Returns
Descriptive information of the Property (for remote UI).

Implements eproperty::Property.

Reimplemented in eproperty::Range< TYPE >.

§ getPropertyType()

template<class TYPE >
std::string eproperty::PropertyType< TYPE >::getPropertyType ( ) const
inlineoverridevirtual

Get the Property type of the class in string mode.

Returns
The string type of the Property.

Implements eproperty::Property.

Reimplemented in eproperty::Range< TYPE >.

§ getString()

template<class TYPE >
std::string eproperty::PropertyType< TYPE >::getString ( ) const
inlineoverridevirtual

Get the string of the current value of the Property.

Returns
The string description of the value.

Implements eproperty::Property.

§ getType()

template<class TYPE >
std::string eproperty::PropertyType< TYPE >::getType ( ) const
inlineoverridevirtual

Get the type of the Property in string mode.

Returns
The string type of the Property.

Implements eproperty::Property.

§ getValueSpecific()

template<class TYPE >
virtual std::string eproperty::PropertyType< TYPE >::getValueSpecific ( const TYPE &  _valueRequested) const
pure virtual

Get the string of the specify value.

Parameters
[in]_valueRequestedValue to convert in string
Returns
convertion of the value in string.

Implemented in eproperty::Value< TYPE >.

§ isDefault()

template<class TYPE >
bool eproperty::PropertyType< TYPE >::isDefault ( ) const
inlineoverridevirtual

Check if the value is the default.

Returns
true : the vakue is the default one, false otherwise.

Implements eproperty::Property.

§ operator const TYPE &()

template<class TYPE >
eproperty::PropertyType< TYPE >::operator const TYPE & ( ) const
inline

Const cast the property in the Type of the data.

Returns
Const reference on the value.

§ operator*()

template<class TYPE >
const TYPE& eproperty::PropertyType< TYPE >::operator* ( ) const
inlinenoexcept

Get the property Value.

Returns
Const reference on the value.

§ operator->()

template<class TYPE >
const TYPE* eproperty::PropertyType< TYPE >::operator-> ( ) const
inlinenoexcept

Get the property Value.

Returns
Const reference on the value.

§ operator=()

template<class TYPE >
PropertyType<TYPE>& eproperty::PropertyType< TYPE >::operator= ( const TYPE &  _newVal)
delete

Assignation opérator (REMOVED)

Parameters
_newValValue to asign
Returns
Reference on current object

§ set()

template<class TYPE >
virtual void eproperty::PropertyType< TYPE >::set ( const TYPE &  _newVal)
inlinevirtual

Set a new value for this parameter.

Parameters
[in]_newValNew value to set (set the nearest value if range is set)

Reimplemented in eproperty::List< TYPE >, and eproperty::Range< TYPE >.

§ setDefault()

template<class TYPE >
void eproperty::PropertyType< TYPE >::setDefault ( )
inlineoverridevirtual

Reset the value to the default value.

Implements eproperty::Property.

§ setDirect()

template<class TYPE >
void eproperty::PropertyType< TYPE >::setDirect ( const TYPE &  _newVal)
inline

Set the value of the current parameter (no check (for internal set with no check).

Note
For performence, this function must be inline
Only use by the owner of the property (can not be check on compile time for now ...) TODO: Do it better ... compile check
Parameters
[in]_newValNew value to set

§ setDirectCheck()

template<class TYPE >
virtual void eproperty::PropertyType< TYPE >::setDirectCheck ( const TYPE &  _newVal)
inlinevirtual

Set the value of the current parameter (check range and ... if needed).

Note
Only use by the owner of the property/
Parameters
[in]_newValNew value to set

Reimplemented in eproperty::List< TYPE >, and eproperty::Range< TYPE >.

Member Data Documentation

§ m_default

template<class TYPE >
TYPE eproperty::PropertyType< TYPE >::m_default
protected

Default value.

§ m_value

template<class TYPE >
TYPE eproperty::PropertyType< TYPE >::m_value
protected

Current value.


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