OpenWalnut
1.4.0
|
A class containing a list of named items. More...
#include <WItemSelection.h>
Public Types | |
typedef boost::shared_ptr < WItemSelection > | SPtr |
Convenience typedef for a boost::shared_ptr< WItemSelection > | |
typedef boost::shared_ptr < const WItemSelection > | ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WItemSelection > | |
Public Member Functions | |
WItemSelection () | |
Default constructor. | |
virtual | ~WItemSelection () |
Destructor. | |
virtual WItemSelector | getSelectorAll () |
Creates an default selection (all items selected). | |
virtual WItemSelector | getSelectorNone () |
Creates an default selection (no items selected). | |
virtual WItemSelector | getSelectorFirst () |
Creates an default selection (first item selected). | |
virtual WItemSelector | getSelectorLast () |
Creates an default selection (last item selected). | |
virtual WItemSelector | getSelector (size_t item) |
Creates an default selection (a specified items selected). | |
void | addItem (std::string name, std::string description="", const char **icon=NULL) |
Convenience method to add a new item. | |
void | addItem (boost::shared_ptr< WItemSelectionItem > item) |
Method to add a new item, which can be derived from WItemSelectionItem. | |
Static Public Member Functions | |
static boost::shared_ptr < WItemSelectionItem > | Item (std::string name, std::string description="", const char **icon=NULL) |
Convenience method to create a new item. | |
Friends | |
class | WItemSelector |
A class containing a list of named items.
It is mainly a container for an std::vector but with the difference that there can be so called Selectors which are able to select some subset of the item set. This is especially useful in properties where item selection is needed. The class is kept very restrictive to keep the interface clean and sleek and to keep the item set consistent among several threads. So please do not implement any function that might change the item list, use the provided ones. If the item list changes, existing selectors get invalid automatically using the change condition of the inherited WSharedSequenceContainer.
Definition at line 49 of file WItemSelection.h.
typedef boost::shared_ptr< const WItemSelection > WItemSelection::ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WItemSelection >
Reimplemented from WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >.
Definition at line 62 of file WItemSelection.h.
typedef boost::shared_ptr< WItemSelection > WItemSelection::SPtr |
Convenience typedef for a boost::shared_ptr< WItemSelection >
Reimplemented from WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >.
Definition at line 57 of file WItemSelection.h.
Default constructor.
Definition at line 36 of file WItemSelection.cpp.
WItemSelection::~WItemSelection | ( | ) | [virtual] |
Destructor.
Definition at line 42 of file WItemSelection.cpp.
void WItemSelection::addItem | ( | std::string | name, |
std::string | description = "" , |
||
const char ** | icon = NULL |
||
) |
Convenience method to add a new item.
name | name of the item |
description | the description, can be empty |
icon | the icon, can be NULL |
Definition at line 103 of file WItemSelection.cpp.
References WSharedSequenceContainer< std::vector< boost::shared_ptr< WItemSelectionItem > > >::push_back().
void WItemSelection::addItem | ( | boost::shared_ptr< WItemSelectionItem > | item | ) |
Method to add a new item, which can be derived from WItemSelectionItem.
item | WItemSelectionItem or derivation which should be add. |
Definition at line 108 of file WItemSelection.cpp.
References WSharedSequenceContainer< std::vector< boost::shared_ptr< WItemSelectionItem > > >::push_back().
WItemSelector WItemSelection::getSelector | ( | size_t | item | ) | [virtual] |
Creates an default selection (a specified items selected).
The selector gets invalid if another item is added.
item | the item to select. |
Definition at line 90 of file WItemSelection.cpp.
References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().
WItemSelector WItemSelection::getSelectorAll | ( | ) | [virtual] |
Creates an default selection (all items selected).
The selector gets invalid if another item is added.
Definition at line 47 of file WItemSelection.cpp.
References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().
WItemSelector WItemSelection::getSelectorFirst | ( | ) | [virtual] |
Creates an default selection (first item selected).
The selector gets invalid if another item is added.
Definition at line 66 of file WItemSelection.cpp.
References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().
WItemSelector WItemSelection::getSelectorLast | ( | ) | [virtual] |
Creates an default selection (last item selected).
The selector gets invalid if another item is added.
Definition at line 78 of file WItemSelection.cpp.
References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().
WItemSelector WItemSelection::getSelectorNone | ( | ) | [virtual] |
Creates an default selection (no items selected).
The selector gets invalid if another item is added.
Definition at line 59 of file WItemSelection.cpp.
References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().
static boost::shared_ptr< WItemSelectionItem > WItemSelection::Item | ( | std::string | name, |
std::string | description = "" , |
||
const char ** | icon = NULL |
||
) | [inline, static] |
Convenience method to create a new item.
name | name of the item |
description | the description, can be empty |
icon | the icon, can be NULL |
Definition at line 120 of file WItemSelection.h.