OpenWalnut  1.4.0
Public Types | Public Member Functions | Static Public Member Functions | Friends
WItemSelection Class Reference

A class containing a list of named items. More...

#include <WItemSelection.h>

+ Inheritance diagram for WItemSelection:

List of all members.

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

Detailed Description

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

Default constructor.

Definition at line 36 of file WItemSelection.cpp.

Destructor.

Definition at line 42 of file WItemSelection.cpp.


Member Function Documentation

void WItemSelection::addItem ( std::string  name,
std::string  description = "",
const char **  icon = NULL 
)

Convenience method to add a new item.

Parameters:
namename of the item
descriptionthe description, can be empty
iconthe 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.

Parameters:
itemWItemSelectionItem or derivation which should be add.

Definition at line 108 of file WItemSelection.cpp.

References WSharedSequenceContainer< std::vector< boost::shared_ptr< WItemSelectionItem > > >::push_back().

Creates an default selection (a specified items selected).

The selector gets invalid if another item is added.

Parameters:
itemthe item to select.
Returns:
an selector.

Definition at line 90 of file WItemSelection.cpp.

References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().

Creates an default selection (all items selected).

The selector gets invalid if another item is added.

Returns:
an selector.

Definition at line 47 of file WItemSelection.cpp.

References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().

Creates an default selection (first item selected).

The selector gets invalid if another item is added.

Returns:
an selector.

Definition at line 66 of file WItemSelection.cpp.

References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().

Creates an default selection (last item selected).

The selector gets invalid if another item is added.

Returns:
an selector.

Definition at line 78 of file WItemSelection.cpp.

References WSharedObject< std::vector< boost::shared_ptr< WItemSelectionItem > > >::getReadTicket().

Creates an default selection (no items selected).

The selector gets invalid if another item is added.

Returns:
an selector.

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.

Parameters:
namename of the item
descriptionthe description, can be empty
iconthe icon, can be NULL
Returns:
the Item.

Definition at line 120 of file WItemSelection.h.


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