GlsMenu  1.5.4
GlsMenu_T< MenuItem_t, MenuItemId_t > Class Template Reference

#include <gls_menu.h>

Inheritance diagram for GlsMenu_T< MenuItem_t, MenuItemId_t >:
GlsMenu GlsMenuDataGroup GlsMenuData

Public Types

typedef MenuItem_t Item_t
 
typedef MenuItemId_t ItemId_t
 
typedef GlsMenuHandlerGroup_T< MenuItem_t > ItemGroup_t
 

Public Member Functions

 GlsMenu_T (const std::string &name, GlsMenuDictionary &dataDict, GlsMenuAction::HandlerCont_t &actionHandlers)
 
virtual ~GlsMenu_T ()
 
ItemGroup_tItems () const
 
MenuItem_t * Item (const ItemId_t &itemId) const
 
void SelectItem (const ItemId_t &itemId)
 
virtual void Hide ()
 
virtual void Show ()
 
const GlsMenuDictionaryAttributes () const
 
virtual std::istream & ReadValue (std::istream &instr)
 
virtual std::ostream & WriteValue (std::ostream &outstr)
 
virtual void Inc (long amount=1)
 

Protected Attributes

GlsMenuDictionary _attr
 The dictionary of attributes for the group attribute. More...
 

Private Attributes

ItemGroup_t_menuItems
 Container of menu items within the menu. More...
 

Detailed Description

template<class MenuItem_t, class MenuItemId_t>
class GlsMenu_T< MenuItem_t, MenuItemId_t >

The GlsMenu_T class provides support for a menu class with a specific menu item class and type to identify the items.

The MenuItem_t template parameter should provide a menu item class derived from the GlsMenuItem base class. The MenuItemId_t template parameter should provide an id type that when streamed out using the << operator, will provide a unique key for a specific menu item within a menu.

Definition at line 126 of file gls_menu.h.

Member Typedef Documentation

template<class MenuItem_t, class MenuItemId_t>
typedef MenuItem_t GlsMenu_T< MenuItem_t, MenuItemId_t >::Item_t

Definition at line 129 of file gls_menu.h.

template<class MenuItem_t, class MenuItemId_t>
typedef GlsMenuHandlerGroup_T<MenuItem_t> GlsMenu_T< MenuItem_t, MenuItemId_t >::ItemGroup_t

Definition at line 131 of file gls_menu.h.

template<class MenuItem_t, class MenuItemId_t>
typedef MenuItemId_t GlsMenu_T< MenuItem_t, MenuItemId_t >::ItemId_t

Definition at line 130 of file gls_menu.h.

Constructor & Destructor Documentation

template<class MenuItem_t, class MenuItemId_t>
GlsMenu_T< MenuItem_t, MenuItemId_t >::GlsMenu_T ( const std::string &  name,
GlsMenuDictionary dataDict,
GlsMenuAction::HandlerCont_t actionHandlers 
)
inline

Class constructor.

Definition at line 138 of file gls_menu.h.

template<class MenuItem_t, class MenuItemId_t>
virtual GlsMenu_T< MenuItem_t, MenuItemId_t >::~GlsMenu_T ( )
inlinevirtual

Class destructor.

Definition at line 155 of file gls_menu.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().

virtual void GlsMenu::Hide ( )
virtualinherited

Hide the menu. Perform necessary logic for when a menu is newly hidden for the first time after being shown. This should not be called on a cyclical basis, but when a "hide menu" event occurs.

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 MenuItem_t, class MenuItemId_t>
MenuItem_t* GlsMenu_T< MenuItem_t, MenuItemId_t >::Item ( const ItemId_t itemId) const
inline

Gain access to the specified menu item.

Parameters
itemIdid of the menu item.
Returns
a pointer to the specified menu item or 0 if the menu item does not exist within this menu.

Definition at line 179 of file gls_menu.h.

template<class MenuItem_t, class MenuItemId_t>
ItemGroup_t* GlsMenu_T< MenuItem_t, MenuItemId_t >::Items ( ) const
inline

Gain access to a container of all the menu items in the menu.

Returns
a container of all the menu items in the menu.

Definition at line 164 of file gls_menu.h.

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

Read attribute dictionary from an input stream.

Parameters
instrinput stream to read value from.

Reimplemented in GlsMFDMenu_T< MenuItem_t, Submenu_t, PageId_t >, and GlsMenuDynDataGroup.

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

template<class MenuItem_t, class MenuItemId_t>
void GlsMenu_T< MenuItem_t, MenuItemId_t >::SelectItem ( const ItemId_t itemId)
inline

Handle selection of one of the menu items.

Parameters
itemIdid of the menu item.

Definition at line 195 of file gls_menu.h.

virtual void GlsMenu::Show ( )
virtualinherited

Show the menu. Perform necessary logic for when a menu is newly shown for the first time or after being hidden. This should not be called on a cyclical basis, but when a "show menu" event occurs.

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 MenuItem_t, class MenuItemId_t>
ItemGroup_t* GlsMenu_T< MenuItem_t, MenuItemId_t >::_menuItems
private

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