ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIMainController.h
Go to the documentation of this file.
1 
11 #ifndef GUIMAINCONTROLLER_H_
12 #define GUIMAINCONTROLLER_H_
13 
14 #include <vector>
15 #include <string>
16 #include <list>
17 
18 #include "Controllers/Controller.h"
19 
20 // forward declaration
21 class StockManager;
22 class GUIObserver;
23 class GUIMainFrame;
24 // add for compilation, BaseController should be enough after
26 
35 //class GUIMainController : public ControllerFrame<ControllerBase>
36 class GUIMainController : public ControllerFrame<MainControllerIndicatorTHStock>
37 {
38  private :
47 
53 
54  public :
59  virtual ~GUIMainController();
60 
62  virtual GUIMainController * GetParentController() {return this;}
63  GUIMainFrame * GetFrame() const {return gui_mainframe;}
64 
67 
76  // why not only the base class here ?? in a template with a observer policy ??
77  //GUIObserver *GetObserver() {return gui_observer;}
78 
80  void UpdateGUIFromController(); // {gui_mainframe->UpdateGUI();}
81 
83  //void GetSelected( MainControllerIndicatorTHStock *child_controller );
84 
85 
87 
91  void AddObserver_Message( std::vector<std::string> & message );
94  virtual void Updated( std::vector<std::string> & message );
95 };
96 
97 #endif /* GUIMAINCONTROLLER */
Singleton class, stores all loaded stocks.
Definition: StockManager.h:42
GUIMainFrame * gui_mainframe
direct link to an unique GUIMainFrame
Controller for a dual frame containing Indicator+THStock(s).
virtual void Updated(std::vector< std::string > &message)
Called through the timer RT2, when new data are present.
void UpdateGUIFromController()
only gui_mainframe->Resize(), but seems necessary when a new frame created
GUIMainController()
Constructor.
void AddObserver_Message(std::vector< std::string > &message)
Only used to setup current_controller, really needed ? not really.
Main controller of the application, linked to the view GUIMainFrame.
void DeleteControllerIndicatorTHStock(MainControllerIndicatorTHStock *control)
Concrete class of an observer.
Definition: GUIObserver.h:29
ControllerBase * fcurrent_controller
most general, may use a more specialized ? seems fine here really needed ?? seems use can be avoided...
MainControllerIndicatorTHStock * CreateMainControllerIndicatorTHStock(bool kmain=false)
Creates child controllers, contains Indicator+THStock(s).
GUIMainframe definition.
Definition: GUIMainFrame.h:31
GUIObserver * gui_observer
Observer for receiving messages from StockManager.
Base class for controllers of the graphical application.
StockManager * fstockmanager
keep a pointer to StockManager from constructor.
virtual GUIMainController * GetParentController()
overwrite the ControllerBase function, no parent for this one, this or 0 from ControllerBase ...
see remark below, much easier if composition than derivation in the case of ListController, same for parent_controller as member <U> easily extends to View as well ( ListView possible ), but strong coupling again
Definition: Controller.h:209
GUIMainFrame * GetFrame() const
StockManager * GetStockManager() const
needed here