GridComputing
Job Management in Grid Computing
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Menu Class Reference

Menu Class. More...

#include <menu.h>

Inheritance diagram for Menu:
IMenu

Classes

class  Item
 A Menu can have many Items. More...
 

Public Member Functions

 Menu (const std::string &label, Menu *parent=nullptr)
 Constructor.
 
 ~Menu ()
 Destructor.
 
uint32 Print () const override
 Prints the menu label and returns the Menu or Menu::Item chosen by the user of the menu.
 
IMenuAddMenu (char indexer, const std::string &label)
 Adds a submenu to this Menu.
 
IMenuAddMenuItem (char indexer, const std::string &label, uint32 val)
 Adds an Item to this Menu.
 
IMenuoperator[] (char indexer)
 Indexer.
 
IMenuoperator[] (char indexer) const
 Const indexer.
 
IMenuGetLastSubMenu ()
 Ability to go to previous Menu.
 
- Public Member Functions inherited from IMenu
 IMenu (const std::string &label, Menu *parent=NULL)
 Constructor.
 
virtual ~IMenu ()
 Virtual destructor.
 
const std::string & GetLabel () const
 Returns the Menu's label.
 
MenuGetParent () const
 Returns the Menu's parent. Can be null.
 
void SetParent (Menu *val)
 Updates the Menu's parent.
 

Static Public Member Functions

static MenuLoad (ByteBuffer &bb)
 Loads the Menu from a ByteBuffer.
 

Private Attributes

std::vector< std::pair< char,
IMenu * > > 
_subMenus
 A vector of submenus.
 

Additional Inherited Members

- Protected Attributes inherited from IMenu
Menu_parent
 Parent menu.
 
std::string _label
 Menu.
 

Detailed Description

Menu Class.

Represents a menu that can have multiple sub-menus and links to other Menus and Menu::Items

Constructor & Destructor Documentation

Menu::Menu ( const std::string &  label,
Menu parent = nullptr 
)

Constructor.

Menu::~Menu ( )

Destructor.

Member Function Documentation

IMenu * Menu::AddMenu ( char  indexer,
const std::string &  label 
)

Adds a submenu to this Menu.

IMenu * Menu::AddMenuItem ( char  indexer,
const std::string &  label,
uint32  val 
)

Adds an Item to this Menu.

IMenu* Menu::GetLastSubMenu ( )

Ability to go to previous Menu.

Menu * Menu::Load ( ByteBuffer bb)
static

Loads the Menu from a ByteBuffer.

IMenu * Menu::operator[] ( char  indexer)

Indexer.

IMenu * Menu::operator[] ( char  indexer) const

Const indexer.

uint32 Menu::Print ( ) const
overridevirtual

Prints the menu label and returns the Menu or Menu::Item chosen by the user of the menu.

Implements IMenu.

Member Data Documentation

std::vector<std::pair<char, IMenu*> > Menu::_subMenus
private

A vector of submenus.


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