25 #ifndef WITEMSELECTIONITEMTYPED_H
26 #define WITEMSELECTIONITEMTYPED_H
33 #include "WItemSelectionItem.h"
42 template<
typename T >
49 typedef std::shared_ptr< WItemSelectionItemTyped< T > >
SPtr;
54 typedef std::shared_ptr< const WItemSelectionItemTyped< T > >
ConstSPtr;
92 static SPtr create( T value, std::string name, std::string description =
"",
const char** icon = NULL )
A derivation of WItemSelection which can store a value of any type.
void setValue(T value)
Sets a new value, which is associated with this item.
static SPtr create(T value, std::string name, std::string description="", const char **icon=NULL)
Create a instance of the item.
const T getValue() const
Returns the value.
std::shared_ptr< WItemSelectionItemTyped< T > > SPtr
Abbreviation for a shared pointer.
T m_value
Value which is stored by this item.
WItemSelectionItemTyped(T value, std::string name, std::string description="", const char **icon=NULL)
Constructs a new item with the specified values.
T getValue()
Returns the value.
virtual ~WItemSelectionItemTyped()
Destruction.
std::shared_ptr< const WItemSelectionItemTyped< T > > ConstSPtr
Abbreviation for a const shared pointer.
T ValueType
The type of the value stored in here.
Class for keeping a single named item in a WItemSelection.
std::shared_ptr< WItemSelectionItem > SPtr
Abbreviation for a shared pointer.