GlsMenu  1.5.4
GlsMenuSet_T< MenuType_t, DataFactory_t > Class Template Reference

#include <gls_menu_set.h>

Inheritance diagram for GlsMenuSet_T< MenuType_t, DataFactory_t >:
GlsMFDMenuSet_T< MenuType_t, DataFactory_t >

Public Types

typedef MenuType_t Menu_t
 

Public Member Functions

 GlsMenuSet_T (GlsMenuDictionary &data)
 
virtual ~GlsMenuSet_T ()
 
Menu_tCurrent () const
 
void RegisterAction (const std::string &name, GlsMenuAction::ActionHandler_t *handler)
 
void SelectItem (const typename Menu_t::ItemId_t &itemId)
 
virtual void Show (const std::string &menuName="")
 
virtual void Read (std::istream &instr)
 
void Read (const std::string &filename)
 
void ReadMenuFiles (const std::string &directory, const std::string &ext="menu")
 
void Write (std::ostream &outstr)
 
void Write (const std::string &filename)
 

Protected Attributes

GlsMenuAction::HandlerCont_t _actionHandlers
 Handlers for menu actions local to an instance of a menu set. Each menu set can have its own set of action handlers. More...
 
GlsMenuDictionary _menuStructure
 Menu structure attribute dictionary contains structure of menu. More...
 
GlsMenuDictionary_menuData
 Menu meta-data attribute dictionary contains variables and values. More...
 
std::string _showMenuName
 
Menu_t_currentMenu
 Currently displayed menu page. More...
 
GlsMenuHandlerGroup_T< Menu_t > * _menus
 Set of all menus. More...
 

Private Member Functions

void ShowMenu (std::istream &args)
 
void ToggleData (std::istream &args) const
 
void SetData (std::istream &args) const
 
void SetDataNoExpand (std::istream &args) const
 
void IncData (std::istream &args) const
 
 GlsMenuSet_T (const GlsMenuSet_T &)
 
GlsMenuSet_Toperator= (const GlsMenuSet_T &)
 

Detailed Description

template<class MenuType_t, class DataFactory_t>
class GlsMenuSet_T< MenuType_t, DataFactory_t >

The GlsMenuSet_T class provides support for a set of menus. The MenuType template parameter should be a class derived from GlsMenu_T and explicitly defines the type of menus contained in the set. The DataFactory_t template parameter should be either the GlsMenuDataFactory class or a class derived from it. This will be used to create data items declared in the menu script files at run-time.

Definition at line 66 of file gls_menu_set.h.

Member Typedef Documentation

template<class MenuType_t , class DataFactory_t >
typedef MenuType_t GlsMenuSet_T< MenuType_t, DataFactory_t >::Menu_t

Definition at line 69 of file gls_menu_set.h.

Constructor & Destructor Documentation

template<class MenuType_t , class DataFactory_t >
virtual GlsMenuSet_T< MenuType_t, DataFactory_t >::~GlsMenuSet_T ( )
inlinevirtual

Class destructor.

Definition at line 127 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::_actionHandlers.

template<class MenuType_t , class DataFactory_t >
GlsMenuSet_T< MenuType_t, DataFactory_t >::GlsMenuSet_T ( const GlsMenuSet_T< MenuType_t, DataFactory_t > &  )
private

Member Function Documentation

template<class MenuType_t , class DataFactory_t >
Menu_t* GlsMenuSet_T< MenuType_t, DataFactory_t >::Current ( ) const
inline

Return the current menu of the set.

Definition at line 149 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::_currentMenu.

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::IncData ( std::istream &  args) const
inlineprivate

Increment meta-data value by some amount.

Definition at line 444 of file gls_menu_set.h.

References GetQuoted(), and GlsMenuData::Inc().

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

template<class MenuType_t , class DataFactory_t >
GlsMenuSet_T& GlsMenuSet_T< MenuType_t, DataFactory_t >::operator= ( const GlsMenuSet_T< MenuType_t, DataFactory_t > &  )
private
template<class MenuType_t , class DataFactory_t >
virtual void GlsMenuSet_T< MenuType_t, DataFactory_t >::Read ( std::istream &  instr)
inlinevirtual

Read in the menu structure and behavior from a stream.

Parameters
instrinput stream to read from.

Reimplemented in GlsMFDMenuSet_T< MenuType_t, DataFactory_t >.

Definition at line 231 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::_menuStructure.

Referenced by GlsMenuSet_T< MenuType_t, DataFactory_t >::Read(), and GlsMenuSet_T< MenuType_t, DataFactory_t >::ReadMenuFiles().

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::Read ( const std::string &  filename)
inline

Read in the menu structure from a file.

Parameters
filenameto read from.

Definition at line 243 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::Read().

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::ReadMenuFiles ( const std::string &  directory,
const std::string &  ext = "menu" 
)
inline

Read in the menu structure and data attributes from all files within a particular directory.

Parameters
directoryto read files from.
extextension of menu files.

Definition at line 268 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::Read().

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::RegisterAction ( const std::string &  name,
GlsMenuAction::ActionHandler_t handler 
)
inline

Register a handler for a specific action local to this menu set. If a handler for an action is not found in the local handlers, a handler will be searched for in the global handler list. Local action names should be unique or else the handler will be replaced by each subsequent call.

Parameters
nameaction name
handlerhandler for the action

Definition at line 163 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::_actionHandlers.

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

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::SelectItem ( const typename Menu_t::ItemId_t &  itemId)
inline

Handle selection of one of the menu items on the current menu.

Parameters
itemIdid of the menu item.

Definition at line 177 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::_currentMenu.

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::SetData ( std::istream &  args) const
inlineprivate

Set meta-data value to a value.

Definition at line 408 of file gls_menu_set.h.

References GetQuoted().

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

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::SetDataNoExpand ( std::istream &  args) const
inlineprivate

Set meta-data value to a value, but don't expand the value first.

Definition at line 426 of file gls_menu_set.h.

References GetQuoted().

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

template<class MenuType_t , class DataFactory_t >
virtual void GlsMenuSet_T< MenuType_t, DataFactory_t >::Show ( const std::string &  menuName = "")
inlinevirtual
template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::ShowMenu ( std::istream &  args)
inlineprivate

Menu action to Show a particular menu page.

Definition at line 372 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::Show().

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

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::ToggleData ( std::istream &  args) const
inlineprivate

Toggle meta-data value between two options.

Definition at line 384 of file gls_menu_set.h.

References GetQuoted().

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

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::Write ( std::ostream &  outstr)
inline

Write out the menu structure and behavior to a stream.

Parameters
outstroutput stream to write to.

Definition at line 316 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::_menuStructure.

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

template<class MenuType_t , class DataFactory_t >
void GlsMenuSet_T< MenuType_t, DataFactory_t >::Write ( const std::string &  filename)
inline

Write out the menu structure and behavior to file.

Parameters
outstroutput stream to write to.

Definition at line 328 of file gls_menu_set.h.

References GlsMenuSet_T< MenuType_t, DataFactory_t >::Write().

Field Documentation

template<class MenuType_t , class DataFactory_t >
GlsMenuAction::HandlerCont_t GlsMenuSet_T< MenuType_t, DataFactory_t >::_actionHandlers
protected

Handlers for menu actions local to an instance of a menu set. Each menu set can have its own set of action handlers.

Definition at line 350 of file gls_menu_set.h.

Referenced by GlsMenuSet_T< MenuType_t, DataFactory_t >::RegisterAction(), and GlsMenuSet_T< MenuType_t, DataFactory_t >::~GlsMenuSet_T().

template<class MenuType_t , class DataFactory_t >
Menu_t* GlsMenuSet_T< MenuType_t, DataFactory_t >::_currentMenu
protected
template<class MenuType_t , class DataFactory_t >
GlsMenuDictionary& GlsMenuSet_T< MenuType_t, DataFactory_t >::_menuData
protected

Menu meta-data attribute dictionary contains variables and values.

Definition at line 356 of file gls_menu_set.h.

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

template<class MenuType_t , class DataFactory_t >
GlsMenuHandlerGroup_T<Menu_t>* GlsMenuSet_T< MenuType_t, DataFactory_t >::_menus
protected
template<class MenuType_t , class DataFactory_t >
GlsMenuDictionary GlsMenuSet_T< MenuType_t, DataFactory_t >::_menuStructure
protected
template<class MenuType_t , class DataFactory_t >
std::string GlsMenuSet_T< MenuType_t, DataFactory_t >::_showMenuName
protected

Definition at line 358 of file gls_menu_set.h.

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


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