GlsMenu  1.5.4
GlsMenuDynDataGroup Class Referenceabstract

#include <gls_menu_data_group.h>

Inheritance diagram for GlsMenuDynDataGroup:
GlsMenuDataGroup GlsMenuData GlsMenuDataGroup_T< T > GlsMenuHandlerGroup_T< T > GlsMenuHandlerGroup_T< GlsMenuTimer > GlsMenuHandlerGroup_T< Menu_t > GlsMenuHandlerGroup_T< State_t > GlsMenuItem_T< State_t >

Public Member Functions

 GlsMenuDynDataGroup (const std::string &name, bool uniqueKeys=true)
 
virtual ~GlsMenuDynDataGroup ()
 
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 =0
 

Protected Attributes

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

The GlsMenuDynDataGroup is the base class for groups of data that can be created dynamically at ReadValue time. If the data 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. Derived classes must override the CreateDataItem method that will instantiate a concrete data item.

Definition at line 121 of file gls_menu_data_group.h.

Constructor & Destructor Documentation

GlsMenuDynDataGroup::GlsMenuDynDataGroup ( const std::string &  name,
bool  uniqueKeys = true 
)

Class constructor.

Parameters
namethe name of the group of data items.
uniqueKeyswhether or not unique keys are required in the group.
virtual GlsMenuDynDataGroup::~GlsMenuDynDataGroup ( )
virtual

Class destructor.

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 GlsMenuData* GlsMenuDynDataGroup::CreateDataItem ( const std::string &  name) const
protectedpure virtual

Create a new instance of our particular data item type using name.

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

Implemented in GlsMenuHandlerGroup_T< T >, GlsMenuHandlerGroup_T< State_t >, GlsMenuHandlerGroup_T< GlsMenuTimer >, GlsMenuHandlerGroup_T< Menu_t >, and GlsMenuDataGroup_T< T >.

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().

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

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

bool GlsMenuDynDataGroup::_uniqueKeys
protected

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: