GlsMenu
gls_mfd_menu_set.h
Go to the documentation of this file.
1 
42 #if !defined(GLS_MFDMENUSET_H)
43 #define GLS_MFDMENUSET_H
44 
45 #ifdef WIN32
46 #pragma warning (disable:4786)
47 #endif
48 
49 #include <sstream>
50 #include <vector>
51 
52 #include "gls_menu_set.h"
53 #include "gls_mfd.h"
54 
55 
56 //----------------------------------------------------------------------------
65 //----------------------------------------------------------------------------
66 template <class MenuType_t, class DataFactory_t>
67 class GlsMFDMenuSet_T : public GlsMenuSet_T<MenuType_t, DataFactory_t>
68 {
69 public:
70 
72 
73  //------------------------------------------------------------------------
77  //------------------------------------------------------------------------
79  BaseClass(dataDict),
80  _MFDSide(side)
81  {
82  }
83 
84  //------------------------------------------------------------------------
88  //------------------------------------------------------------------------
89  virtual ~GlsMFDMenuSet_T() {}
90 
91  //------------------------------------------------------------------------
100  //------------------------------------------------------------------------
101  using BaseClass::Read;
102  virtual void Read(std::istream& instr)
103  {
104  std::string MFD_Name(GlsMFD::Name(_MFDSide));
105 
106  // Read in the menu script
107  std::stringstream script;
108  script << instr.rdbuf();
109 
110  std::string xls(script.str());
111  std::string::size_type pos(0);
112  while ((pos = xls.find("$(MFD)", pos)) != std::string::npos)
113  {
114  xls.replace(pos, 6, MFD_Name);
115  }
116  script.str(xls);
117  _menuStructure.Read(script);
118  }
119 
120 protected:
121 
124 
125 private:
126 
127  // = Unimplemented methods, disallow copies
130 
131 }; // end GlsMFDMenuSet
132 
133 
134 #endif // GLS_MFDMENUSET_H
GlsMenuSet_T< MenuType_t, DataFactory_t > BaseClass
GlsMFDMenuSet_T(GlsMFD::Side_t side, GlsMenuDictionary &dataDict)
Side_t
Definition: gls_mfd.h:60
GlsMenuDictionary _menuStructure
Menu structure attribute dictionary contains structure of menu.
Definition: gls_menu_set.h:360
This file defines classes to implement a set of menus.
std::string Name(Side_t side)
Definition: gls_mfd.h:81
virtual ~GlsMFDMenuSet_T()
GlsMFD::Side_t _MFDSide
Which MFD this menu set is for (left or right)
GlsMFDMenuSet_T & operator=(const GlsMFDMenuSet_T &)
virtual void Read(std::istream &instr)
This file defines common MFD types.
virtual void Read(std::istream &instr)
Definition: gls_menu_set.h:236