OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Private Attributes | Friends | List of all members
WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > Class Template Reference

This is a property which encapsulates a given, fixed number of other properties. More...

#include <WPropertyStruct.h>

+ Inheritance diagram for WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >:
+ Collaboration diagram for WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >:

Public Types

typedef WPropertyStruct< BOOST_PP_ENUM_PARAMS(10, T) > WPropertyStructType
 The type of this template instantiation. More...
 
typedef std::shared_ptr< WPropertyStructTypeSPtr
 Convenience typedef for a std::shared_ptr< WPropertyStructType > More...
 
typedef std::shared_ptr< const WPropertyStructTypeConstSPtr
 Convenience typedef for a std::shared_ptr< const WPropertyStructType > More...
 
typedef WPropertyStructHelper::AsVector< BOOST_PP_ENUM_PARAMS(10, T) >::type TypeVector
 The boost mpl vector for all the types specified. More...
 
typedef WPropertyStructHelper::SequenceToTuple< TypeVector >::type TupleType
 The type vector as a boost tuple. More...
 
- Public Types inherited from WPropertyGroupBase
typedef std::vector< std::shared_ptr< WPropertyBase > > PropertyContainerType
 For shortening: a type defining a shared vector of WSubject pointers. More...
 
typedef WSharedSequenceContainer< PropertyContainerTypePropertySharedContainerType
 The alias for a shared container. More...
 
typedef PropertyContainerType::const_iterator PropertyConstIterator
 The const iterator type of the container. More...
 
typedef PropertyContainerType::iterator PropertyIterator
 The iterator type of the container. More...
 
typedef std::shared_ptr< WPropertyGroupBaseSPtr
 Convenience typedef for a std::shared_ptr< WPropertyGroupBase >. More...
 
typedef std::shared_ptr< const WPropertyGroupBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WPropertyGroupBase >. More...
 
typedef boost::function< void(std::string, std::string)> PropertyStringVisitor
 The visitor type used to visit properties as strings. More...
 
- Public Types inherited from WPropertyBase
typedef std::shared_ptr< WPropertyBaseSPtr
 Convenience typedef for a std::shared_ptr< WPropertyBase > More...
 
typedef std::shared_ptr< const WPropertyBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WPropertyBase > More...
 
typedef boost::function< void(std::shared_ptr< WPropertyBase >)> PropertyChangeNotifierType
 Signal signature emitted during set operations. More...
 

Public Member Functions

 WPropertyStruct (std::string name, std::string description)
 Create an empty named property. More...
 
 WPropertyStruct (const WPropertyStructType &from)
 Copy constructor. More...
 
virtual ~WPropertyStruct ()
 Destructor. More...
 
template<int N>
boost::mpl::at< TypeVector, boost::mpl::size_t< N > >::type getProperty ()
 Get the N'th property in the struct. More...
 
template<int N>
boost::mpl::at< TypeVector, boost::mpl::size_t< N > >::type::element_type::ConstSPtr getProperty () const
 Get the N'th property in the struct. More...
 
const WPropertyBase::SPtrgetProperty (size_t n) const
 Returns the property with the given number, but only as base type. More...
 
WPropertyBase::SPtr getProperty (size_t n)
 Returns the property with the given number, but only as base type. More...
 
size_t size () const
 The size of the WPropertyStruct. More...
 
virtual WPropertyBase::SPtr clone ()
 This method clones a property and returns the clone. More...
 
virtual PROPERTY_TYPE getType () const
 Gets the real WPropertyVariable type of this instance. More...
 
virtual bool setAsString (std::string value)
 This methods allows properties to be set by a string value. More...
 
virtual std::string getAsString ()
 Returns the current value as a string. More...
 
virtual bool set (std::shared_ptr< WPropertyBase > value, bool recommendedOnly=false)
 Sets the value from the specified property to this one. More...
 
- Public Member Functions inherited from WPropertyGroupBase
 WPropertyGroupBase (std::string name, std::string description)
 Constructor. More...
 
 WPropertyGroupBase (const WPropertyGroupBase &from)
 Copy constructor. More...
 
virtual ~WPropertyGroupBase ()
 Destructor. More...
 
virtual bool existsProperty (std::string name)
 Helper function that finds a property by its name. More...
 
virtual std::shared_ptr< WPropertyBasegetProperty (std::string name)
 Function searches the property. More...
 
virtual PropertySharedContainerType::ReadTicket getProperties () const
 Returns a read ticket for read-access to the list of properties. More...
 
virtual PropertySharedContainerType::ReadTicket getReadTicket () const
 Returns an read ticket for the properties. More...
 
virtual std::shared_ptr< WPropertyBasefindProperty (std::string name) const
 Searches the property with a given name. More...
 
virtual void visitAsString (PropertyStringVisitor visitor, std::string pathPrefix="") const
 Visit all leafs in the property three that aren't empty groups. More...
 
bool autoHideEmpty () const
 Checks whether the property group should be hidden if it is empty. More...
 
void setAutoHideEmpty (bool autoHide=true)
 Should the property group be hidden automatically if it is empty? By default, this is true. More...
 
- Public Member Functions inherited from WPropertyBase
 WPropertyBase (std::string name, std::string description)
 Create an empty named property. More...
 
 WPropertyBase (const WPropertyBase &from)
 Copy constructor. More...
 
virtual ~WPropertyBase ()
 Destructor. More...
 
std::string getName () const
 Gets the name of the class. More...
 
std::string getDescription () const
 Gets the description of the property. More...
 
bool isHidden () const
 Determines whether the property is hidden or not. More...
 
void setHidden (bool hidden=true)
 Sets the property hidden. More...
 
virtual PROPERTY_PURPOSE getPurpose () const
 Gets the purpose of a property. More...
 
virtual void setPurpose (PROPERTY_PURPOSE purpose)
 Sets the purpose of the property. More...
 
template<typename T >
bool set (const T &value)
 Shortcut to set a property with a given value. More...
 
virtual std::shared_ptr< WConditiongetUpdateCondition () const
 This method returns a condition which gets fired whenever the property changes somehow. More...
 
WPropInt toPropInt ()
 Helper converts this instance to its native type. More...
 
WPropDouble toPropDouble ()
 Helper converts this instance to its native type. More...
 
WPropBool toPropBool ()
 Helper converts this instance to its native type. More...
 
WPropString toPropString ()
 Helper converts this instance to its native type. More...
 
WPropFilename toPropFilename ()
 Helper converts this instance to its native type. More...
 
WPropSelection toPropSelection ()
 Helper converts this instance to its native type. More...
 
WPropColor toPropColor ()
 Helper converts this instance to its native type. More...
 
WPropPosition toPropPosition ()
 Helper converts this instance to its native type. More...
 
WPropTrigger toPropTrigger ()
 Helper converts this instance to its native type. More...
 
WPropMatrix4X4 toPropMatrix4X4 ()
 Helper converts this instance to its native type. More...
 
WPropTransferFunction toPropTransferFunction ()
 Helper converts this instance to its native type. More...
 
WPropGroup toPropGroup ()
 Helper converts this instance to its native type. More...
 
WPropInterval toPropInterval ()
 Helper converts this instance to its native type. More...
 
std::shared_ptr< WPropertyGroupBasetoPropGroupBase ()
 Convert the property to a WPropertyGroupBase. More...
 
template<typename T >
std::shared_ptr< WPropertyVariable< T > > toPropertyVariable ()
 Helper converts this instance to an arbitrary type. More...
 

Static Private Attributes

static const size_t m_size = boost::mpl::size< TypeVector >::value
 How many elements are in this WPropertyStruct? More...
 

Friends

class WPropertyStructTest
 Access for test class. More...
 

Additional Inherited Members

- Static Public Attributes inherited from WPropertyGroupBase
static const std::string separator = "/"
 The separator used to separate groups and subgroups. More...
 
- Protected Types inherited from WPropertyBase
typedef boost::signals2::signal< void(std::shared_ptr< WPropertyBase >)> PropertyChangeSignalType
 Signal used for firing change signals. More...
 
- Protected Member Functions inherited from WPropertyGroupBase
virtual std::shared_ptr< WPropertyBasefindProperty (const WPropertyGroupBase *const props, std::string name) const
 Helping function to find a property inside a specific group. More...
 
bool propNamePredicate (std::shared_ptr< WPropertyBase > prop1, std::shared_ptr< WPropertyBase > prop2) const
 Compares the names of two properties and returns true if they are equal. More...
 
void addArbitraryProperty (WPropertyBase::SPtr prop)
 Insert the specified property into the list. More...
 
- Protected Member Functions inherited from WPropertyBase
virtual void updateType ()
 Calculates the type of the property. More...
 
- Protected Attributes inherited from WPropertyGroupBase
PropertySharedContainerType m_properties
 The set of proerties. More...
 
- Protected Attributes inherited from WPropertyBase
std::string m_name
 Name of the property. More...
 
std::string m_description
 Description of the property. More...
 
bool m_hidden
 Flag denoting whether the property is hidden or not. More...
 
PROPERTY_TYPE m_type
 Type of the PropertyVariable instance. More...
 
PROPERTY_PURPOSE m_purpose
 The purpose of this property. More...
 
PropertyChangeSignalType signal_PropertyChange
 Signal getting fired whenever the property changes. More...
 
std::shared_ptr< WConditionSetm_updateCondition
 Condition notified whenever something changes. More...
 

Detailed Description

template<typename T0, typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
class WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >

This is a property which encapsulates a given, fixed number of other properties.

You can specify up to 10 properties. This can be seen similar to the "struct" in the C++ language. A WPropertyStruct can basically seen as WPropertyGroup, but is different in a certain way: it is fixed size (defined on compile time), it allows getting each property with their correct type and provides the appearance as if this property is only ONE object and not a group of multiple objects.

Note
the limitation to 10 types is due to the boost::tuple. If you need more, you need to replace the tuple type as storage-backend.
if we use C++11 some day, we could use variadic templates here.
Template Parameters
T0first type. Mandatory.
T1additional type. Optional.
T2additional type. Optional.
T3additional type. Optional.
T4additional type. Optional.
T5additional type. Optional.
T6additional type. Optional.
T7additional type. Optional.
T8additional type. Optional.
T9additional type. Optional.

Definition at line 198 of file WPropertyStruct.h.

Member Typedef Documentation

◆ ConstSPtr

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
typedef std::shared_ptr< const WPropertyStructType > WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::ConstSPtr

Convenience typedef for a std::shared_ptr< const WPropertyStructType >

Definition at line 215 of file WPropertyStruct.h.

◆ SPtr

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
typedef std::shared_ptr< WPropertyStructType > WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::SPtr

Convenience typedef for a std::shared_ptr< WPropertyStructType >

Definition at line 210 of file WPropertyStruct.h.

◆ TupleType

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
typedef WPropertyStructHelper::SequenceToTuple< TypeVector >::type WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::TupleType

The type vector as a boost tuple.

Definition at line 225 of file WPropertyStruct.h.

◆ TypeVector

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
typedef WPropertyStructHelper::AsVector< BOOST_PP_ENUM_PARAMS( 10, T ) >::type WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::TypeVector

The boost mpl vector for all the types specified.

Definition at line 220 of file WPropertyStruct.h.

◆ WPropertyStructType

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
typedef WPropertyStruct< BOOST_PP_ENUM_PARAMS( 10, T ) > WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::WPropertyStructType

The type of this template instantiation.

Definition at line 205 of file WPropertyStruct.h.

Constructor & Destructor Documentation

◆ WPropertyStruct() [1/2]

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::WPropertyStruct ( std::string  name,
std::string  description 
)
inline

Create an empty named property.

Parameters
namethe name of the property
descriptionthe description of the property

Definition at line 233 of file WPropertyStruct.h.

References WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType >::createAndAdd().

+ Here is the call graph for this function:

◆ WPropertyStruct() [2/2]

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::WPropertyStruct ( const WPropertyStructType from)
inlineexplicit

Copy constructor.

Creates a deep copy of this property. As boost::signals2 and condition variables are non-copyable, new instances get created. The subscriptions to a signal are LOST as well as all listeners to a condition.

Parameters
fromthe instance to copy.

Definition at line 255 of file WPropertyStruct.h.

◆ ~WPropertyStruct()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
virtual WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::~WPropertyStruct ( )
inlinevirtual

Destructor.

Definition at line 264 of file WPropertyStruct.h.

Member Function Documentation

◆ clone()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
virtual WPropertyBase::SPtr WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::clone ( )
inlinevirtual

This method clones a property and returns the clone.

It does a deep copy and, in contrast to a copy constructor, creates property with the correct type without explicitly requiring the user to specify it. It creates a NEW change condition and change signal. This means, alls subscribed signal handlers are NOT copied.

Note
this simply ensures the copy constructor of the runtime type is issued.
Returns
the deep clone of this property.

Implements WPropertyBase.

Definition at line 350 of file WPropertyStruct.h.

◆ getAsString()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
virtual std::string WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getAsString ( )
inlinevirtual

Returns the current value as a string.

This is useful for debugging or project files. It is not implemented as << operator, since the << should also print min/max constraints and so on. This simply is the value.

Returns
the value as a string.

Implements WPropertyBase.

Definition at line 402 of file WPropertyStruct.h.

References WSharedObject< T >::getReadTicket(), WPropertyGroupBase::m_properties, and WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::size().

+ Here is the call graph for this function:

◆ getProperty() [1/4]

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
template<int N>
boost::mpl::at< TypeVector, boost::mpl::size_t< N > >::type WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getProperty ( )
inline

Get the N'th property in the struct.

Template Parameters
Nthe number of the property to get.
Returns
the property.

Definition at line 277 of file WPropertyStruct.h.

Referenced by WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getProperty().

+ Here is the caller graph for this function:

◆ getProperty() [2/4]

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
template<int N>
boost::mpl::at< TypeVector, boost::mpl::size_t< N > >::type::element_type::ConstSPtr WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getProperty ( ) const
inline

Get the N'th property in the struct.

Template Parameters
Nthe number of the property to get.
Returns
the property.

Definition at line 291 of file WPropertyStruct.h.

References WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getProperty().

+ Here is the call graph for this function:

◆ getProperty() [3/4]

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
WPropertyBase::SPtr WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getProperty ( size_t  n)
inline

Returns the property with the given number, but only as base type.

The advantage is that the property number can be specified during runtime.

Parameters
nthe number of the property
Returns
the property

Definition at line 320 of file WPropertyStruct.h.

References WSharedObject< T >::getReadTicket(), and WPropertyGroupBase::m_properties.

+ Here is the call graph for this function:

◆ getProperty() [4/4]

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
const WPropertyBase::SPtr& WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getProperty ( size_t  n) const
inline

Returns the property with the given number, but only as base type.

The advantage is that the property number can be specified during runtime.

Parameters
nthe number of the property
Returns
the property

Definition at line 305 of file WPropertyStruct.h.

References WSharedObject< T >::getReadTicket(), and WPropertyGroupBase::m_properties.

+ Here is the call graph for this function:

◆ getType()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
virtual PROPERTY_TYPE WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getType ( ) const
inlinevirtual

Gets the real WPropertyVariable type of this instance.

Returns
the real type.

Reimplemented from WPropertyBase.

Definition at line 361 of file WPropertyStruct.h.

◆ set()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
virtual bool WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::set ( std::shared_ptr< WPropertyBase value,
bool  recommendedOnly = false 
)
inlinevirtual

Sets the value from the specified property to this one.

This is especially useful to copy a value without explicitly casting/knowing the dynamic type of the property.

Parameters
valuethe new value.
recommendedOnlyif true, property types which support recommended values apply the given value as recommendation.
Returns
true if the value has been accepted.

Implements WPropertyBase.

Definition at line 427 of file WPropertyStruct.h.

References WSharedObject< T >::getReadTicket(), WPropertyGroupBase::m_properties, and WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::size().

+ Here is the call graph for this function:

◆ setAsString()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
virtual bool WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::setAsString ( std::string  value)
inlinevirtual

This methods allows properties to be set by a string value.

This is especially useful when a property is only available as string and the real type of the property is unknown. This is a shortcut for casting the property and then setting the lexically casted value.

Parameters
valuethe new value to set.
Returns
true if value could be set.

Implements WPropertyBase.

Definition at line 374 of file WPropertyStruct.h.

References WSharedObject< T >::getReadTicket(), WPropertyGroupBase::m_properties, WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::size(), and string_utils::tokenize().

+ Here is the call graph for this function:

◆ size()

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
size_t WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::size ( ) const
inline

The size of the WPropertyStruct.

This returns the number of properties encapsulated.

Returns
number of properties in struct

Definition at line 332 of file WPropertyStruct.h.

References WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::m_size.

Referenced by WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::getAsString(), WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::set(), and WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::setAsString().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ WPropertyStructTest

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
friend class WPropertyStructTest
friend

Access for test class.

Definition at line 200 of file WPropertyStruct.h.

Member Data Documentation

◆ m_size

template<typename T0 , typename T1 = WPropertyStructHelper::NOTYPE, typename T2 = WPropertyStructHelper::NOTYPE, typename T3 = WPropertyStructHelper::NOTYPE, typename T4 = WPropertyStructHelper::NOTYPE, typename T5 = WPropertyStructHelper::NOTYPE, typename T6 = WPropertyStructHelper::NOTYPE, typename T7 = WPropertyStructHelper::NOTYPE, typename T8 = WPropertyStructHelper::NOTYPE, typename T9 = WPropertyStructHelper::NOTYPE>
const size_t WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::m_size = boost::mpl::size< TypeVector >::value
staticprivate

How many elements are in this WPropertyStruct?

Definition at line 455 of file WPropertyStruct.h.

Referenced by WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::size().


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