TwiceAsNice  2019-02-18
Public Member Functions | Protected Attributes | List of all members
Nice::PropertyAttribute Struct Reference

Attribute for a property, can be any type available also for Property. More...

#include <Attribute.h>

Inheritance diagram for Nice::PropertyAttribute:
Inheritance graph
Collaboration diagram for Nice::PropertyAttribute:
Collaboration graph

Public Member Functions

 PropertyAttribute (const PropertyFooPtr &_foo)
 Constructor. More...
 
template<typename T >
 PropertyAttribute (const T &_val=T())
 Constructor. More...
 
virtual PropertyAttributeclone ()
 Constructor. More...
 
virtual ~PropertyAttribute ()
 Destructor. More...
 
virtual std::string type ()
 Abstract function for requesting the stringified type of m_o. More...
 
virtual std::string toString ()
 Cast the PropertyAttribute to a string. More...
 
virtual const Nice::Anyany () const
 Cast the PropertyAttribute to a string. More...
 
template<typename T >
get ()
 get m_o to a type T More...
 
std::string getValueOf (const std::string &_id, const std::string &_default="")
 get the second value of a map item. More...
 
template<typename T >
void set (const T &_v)
 Methode to set the value of this property. More...
 

Protected Attributes

PropertyFooPtr m_foo
 

Detailed Description

Attribute for a property, can be any type available also for Property.

Author
Version
Date
2008-05-10 10:16:11

Constructor & Destructor Documentation

◆ PropertyAttribute() [1/2]

Nice::PropertyAttribute::PropertyAttribute ( const PropertyFooPtr _foo)
inline

Constructor.

Returns
Cloned instance.

◆ PropertyAttribute() [2/2]

template<typename T >
Nice::PropertyAttribute::PropertyAttribute ( const T &  _val = T())
inline

Constructor.

Returns
Cloned instance.

◆ ~PropertyAttribute()

virtual Nice::PropertyAttribute::~PropertyAttribute ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ any()

virtual const Nice::Any& Nice::PropertyAttribute::any ( ) const
inlinevirtual

Cast the PropertyAttribute to a string.

Returns
Stringified Property. Abstract function for requesting the Nice::Any.
Nice::Any.

◆ clone()

virtual PropertyAttribute* Nice::PropertyAttribute::clone ( )
inlinevirtual

Constructor.

Returns
Cloned instance. Abstract function clones a PropertyAttribute instance.
Cloned instance.

◆ get()

template<typename T >
T Nice::PropertyAttribute::get ( void  )
inline

get m_o to a type T

Returns
Casted type.

◆ getValueOf()

std::string Nice::PropertyAttribute::getValueOf ( const std::string &  _id,
const std::string &  _default = "" 
)
inline

get the second value of a map item.

This only gives back a string if the attribute is of type map<string,string> which defined a key and a value attribute e.g. "UNIT"="mm"

Returns
Value of attribute with _id.

◆ set()

template<typename T >
void Nice::PropertyAttribute::set ( const T &  _v)
inline

Methode to set the value of this property.

The value type has to match the current type.

Parameters
Valueto set.

◆ toString()

virtual std::string Nice::PropertyAttribute::toString ( )
inlinevirtual

Cast the PropertyAttribute to a string.

Returns
Stringified Property.

◆ type()

virtual std::string Nice::PropertyAttribute::type ( )
inlinevirtual

Abstract function for requesting the stringified type of m_o.

Returns
Stringified type.

Member Data Documentation

◆ m_foo

PropertyFooPtr Nice::PropertyAttribute::m_foo
protected

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