GlsMenu  1.5.4
GlsMenuHandlerGroup_T< T > Class Template Reference

#include <gls_menu_data_group.h>

Inheritance diagram for GlsMenuHandlerGroup_T< T >:
GlsMenuDynDataGroup GlsMenuDataGroup GlsMenuData

Public Member Functions

 GlsMenuHandlerGroup_T (const std::string &name, GlsMenuDictionary &dataDict, GlsMenuAction::HandlerCont_t &actionHandlers, bool uniqueKeys=true)
 
virtual ~GlsMenuHandlerGroup_T ()
 
T * Item (const std::string &name) const
 
virtual std::istream & ReadValue (std::istream &instr)
 
const GlsMenuDictionaryAttributes () const
 
virtual std::ostream & WriteValue (std::ostream &outstr)
 
virtual void Inc (long amount=1)
 

Protected Member Functions

virtual GlsMenuDataCreateDataItem (const std::string &name) const
 

Protected Attributes

GlsMenuDictionary_dataDict
 Data dictionary to pass to items created in the group. This is the dictionary used to evaluate menu data variables. More...
 
GlsMenuAction::HandlerCont_t_handlers
 
bool _uniqueKeys
 Specifies whether attribute names should be unique or not. More...
 
GlsMenuDictionary _attr
 The dictionary of attributes for the group attribute. More...
 

Detailed Description

template<class T>
class GlsMenuHandlerGroup_T< T >

The GlsMenuHandlerGroup_T is the base class for groups of items that can be created dynamically at ReadValue time. If the item does NOT already exist, it will be created and added to the attribute group dictionary, otherwise its value will be updated. The class supports either unique or multiple keys. Items must accept 3 parameters,

  1. name, 2. data dictionary, 3. container of local action handlers

Definition at line 252 of file gls_menu_data_group.h.

Constructor & Destructor Documentation

template<class T>
GlsMenuHandlerGroup_T< T >::GlsMenuHandlerGroup_T ( const std::string &  name,
GlsMenuDictionary dataDict,
GlsMenuAction::HandlerCont_t actionHandlers,
bool  uniqueKeys = true 
)
inline

Class constructor.

Parameters
namethe name of the group of data items.
dataDictthe menu data dictionary used to evaluate menu data variables
actionHandlersThese are handlers for menu actions passed in by the creator. These are considered local to the menu set.
uniqueKeyswhether or not unique keys are required in the group.

Definition at line 267 of file gls_menu_data_group.h.

template<class T>
virtual GlsMenuHandlerGroup_T< T >::~GlsMenuHandlerGroup_T ( )
inlinevirtual

Class destructor.

Definition at line 282 of file gls_menu_data_group.h.

Member Function Documentation

const GlsMenuDictionary& GlsMenuDataGroup::Attributes ( ) const
inlineinherited

Read attribute dictionary from an input stream.

Parameters
instrinput stream to read value from.

Definition at line 78 of file gls_menu_data_group.h.

References GlsMenuDataGroup::_attr.

Referenced by GlsMFDMenu_T< MenuItem_t, Submenu_t, PageId_t >::ReadValue().

template<class T>
virtual GlsMenuData* GlsMenuHandlerGroup_T< T >::CreateDataItem ( const std::string &  name) const
inlineprotectedvirtual

Create a new instance of our particular data item type. In this case, it is an menu item that will accept action handlers, since it or one of its components will handle actions.

Parameters
namename of the data item.
Returns
a pointer to the item or 0 if the item cannot be created.

Implements GlsMenuDynDataGroup.

Definition at line 319 of file gls_menu_data_group.h.

virtual void GlsMenuData::Inc ( long  amount = 1)
virtualinherited

Increment the data item. Derived classes must override this as the default is a no-op.

Reimplemented in GlsMenuDiscrete_T< T >.

Referenced by GlsMenuSet_T< MenuType_t, DataFactory_t >::IncData().

template<class T>
T* GlsMenuHandlerGroup_T< T >::Item ( const std::string &  name) const
inline

Gain access to a particular meta-data item within the group.

Parameters
namename of the meta-data item.
Returns
a pointer to the item or 0 if the item does not exist within the group.

Definition at line 294 of file gls_menu_data_group.h.

Referenced by GlsMenu_T< MenuItem_t, GlsMFD::MenuItemId_t >::Item(), GlsMenu_T< MenuItem_t, GlsMFD::MenuItemId_t >::SelectItem(), and GlsMenuSet_T< MenuType_t, DataFactory_t >::Show().

virtual std::istream& GlsMenuDynDataGroup::ReadValue ( std::istream &  instr)
virtualinherited

Read attribute dictionary from an input stream.

Parameters
instrinput stream to read value from.

Reimplemented from GlsMenuDataGroup.

virtual std::ostream& GlsMenuDataGroup::WriteValue ( std::ostream &  outstr)
virtualinherited

Read attribute dictionary from an input stream.

Parameters
instrinput stream to read value from.

Field Documentation

template<class T>
GlsMenuDictionary& GlsMenuHandlerGroup_T< T >::_dataDict
protected

Data dictionary to pass to items created in the group. This is the dictionary used to evaluate menu data variables.

Definition at line 302 of file gls_menu_data_group.h.

template<class T>
GlsMenuAction::HandlerCont_t& GlsMenuHandlerGroup_T< T >::_handlers
protected

Definition at line 306 of file gls_menu_data_group.h.

bool GlsMenuDynDataGroup::_uniqueKeys
protectedinherited

Specifies whether attribute names should be unique or not.

Definition at line 151 of file gls_menu_data_group.h.


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