ROOT_Application
2.0
C++ Core modules and GUIStock
|
Main controller of the application, linked to the view GUIMainFrame. More...
#include <GUIMainController.h>
Public Member Functions | |
GUIMainController () | |
Constructor. More... | |
virtual | ~GUIMainController () |
virtual GUIMainController * | GetParentController () |
overwrite the ControllerBase function, no parent for this one, this or 0 from ControllerBase More... | |
GUIMainFrame * | GetFrame () const |
StockManager * | GetStockManager () const |
needed here More... | |
MainControllerIndicatorTHStock * | CreateMainControllerIndicatorTHStock (bool kmain=false) |
Creates child controllers, contains Indicator+THStock(s). More... | |
void | DeleteControllerIndicatorTHStock (MainControllerIndicatorTHStock *control) |
void | UpdateGUIFromController () |
only gui_mainframe->Resize(), but seems necessary when a new frame created More... | |
void | AddObserver_Message (std::vector< std::string > &message) |
Only used to setup current_controller, really needed ? not really. More... | |
virtual void | Updated (std::vector< std::string > &message) |
Called through the timer RT2, when new data are present. More... | |
Public Member Functions inherited from ControllerFrame< MainControllerIndicatorTHStock > | |
ControllerFrame () | |
ControllerFrame (ControllerBase *parent, std::string name="") | |
virtual | ~ControllerFrame () |
Public Member Functions inherited from ControllerBase | |
ControllerBase () | |
ControllerBase (ControllerBase *parent, std::string cont_name) | |
virtual | ~ControllerBase () |
std::string | GetName () const |
ControllerBase * | GetParentController () |
Public Member Functions inherited from ListController< MainControllerIndicatorTHStock > | |
ListController () | |
virtual | ~ListController () |
void | AddController (MainControllerIndicatorTHStock *control) |
Common Function for dealing with the list, need a name, may call other controllers... More... | |
void | RemoveController (MainControllerIndicatorTHStock *control) |
MainControllerIndicatorTHStock * | GetController (std::string name) |
MainControllerIndicatorTHStock * | GetFirstController () |
get the first controller in list, useful after a delete More... | |
virtual void | DeleteList (bool call_delete=true) |
Iterative call for deleting child controller. More... | |
virtual unsigned int | GetSizeListController () const |
Private Attributes | |
StockManager * | fstockmanager |
keep a pointer to StockManager from constructor. More... | |
GUIObserver * | gui_observer |
Observer for receiving messages from StockManager. More... | |
GUIMainFrame * | gui_mainframe |
direct link to an unique GUIMainFrame More... | |
ControllerBase * | fcurrent_controller |
most general, may use a more specialized ? seems fine here really needed ?? seems use can be avoided... More... | |
Additional Inherited Members | |
Protected Types inherited from ListController< MainControllerIndicatorTHStock > | |
typedef std::list < MainControllerIndicatorTHStock * > ::iterator | it_list |
useful typedef for the class ( and derivatives !) More... | |
Protected Attributes inherited from ListController< MainControllerIndicatorTHStock > | |
std::list < MainControllerIndicatorTHStock * > | list_controller |
list more convenient, remove if not shown ?, or insert More... | |
Main controller of the application, linked to the view GUIMainFrame.
Should be only one, if deals with the main event loop of the application. Singleton ?? helpful ?? to see later.
Definition at line 36 of file GUIMainController.h.
GUIMainController::GUIMainController | ( | ) |
Constructor.
Definition at line 20 of file GUIMainController.cxx.
References Subject::attach(), CreateMainControllerIndicatorTHStock(), fcurrent_controller, fstockmanager, GUIMainFrame::GetFrame(), StockManager::getInstance(), Utils::GetPathData(), StockManager::GetSubject(), gui_mainframe, and gui_observer.
|
virtual |
Definition at line 64 of file GUIMainController.cxx.
References ListController< MainControllerIndicatorTHStock >::DeleteList(), and gui_mainframe.
void GUIMainController::AddObserver_Message | ( | std::vector< std::string > & | message | ) |
Only used to setup current_controller, really needed ? not really.
To improve, may move / call a subframe.
Message received from StockManager through the Observer pattern Called by gui_controller
Definition at line 196 of file GUIMainController.cxx.
References gui_mainframe, and GUIMainFrame::UpdateRT().
Referenced by GUIObserver::update().
MainControllerIndicatorTHStock * GUIMainController::CreateMainControllerIndicatorTHStock | ( | bool | kmain = false | ) |
Creates child controllers, contains Indicator+THStock(s).
Creates a child controller for getting toolbar, text validation, pad for drawing THStock and THStockIndicators Add to the list of controller Need to return a new one for independent frame, really need to return ? maybe a better name, CreateEmpty.
Option to have an independent frame, multi-screen.\ public because called by MainControllerIndicatorTHStock, or use intermediate function ...
kmain | : bool, default false is not an independent frame |
Definition at line 95 of file GUIMainController.cxx.
References ListController< MainControllerIndicatorTHStock >::AddController(), GUIMainFrame::GetFrame(), and gui_mainframe.
Referenced by GUIMainController(), and MainControllerIndicatorTHStock::Validation().
void GUIMainController::DeleteControllerIndicatorTHStock | ( | MainControllerIndicatorTHStock * | control | ) |
Definition at line 132 of file GUIMainController.cxx.
References ListController< MainControllerIndicatorTHStock >::RemoveController().
Referenced by MainControllerIndicatorTHStock::DeleteIndicatorTHstock().
|
inline |
Definition at line 63 of file GUIMainController.h.
References gui_mainframe.
|
inlinevirtual |
overwrite the ControllerBase function, no parent for this one, this or 0 from ControllerBase
Definition at line 62 of file GUIMainController.h.
|
inline |
needed here
Definition at line 66 of file GUIMainController.h.
References fstockmanager.
Referenced by MainControllerIndicatorTHStock::GetStockManager().
|
virtual |
Called through the timer RT2, when new data are present.
Called by GUIMainFrame::CheckUpdateRT when frealtime2 timeout is received Here only broadcast the message to child controllers.
Implements ControllerBase.
Definition at line 163 of file GUIMainController.cxx.
References ListController< MainControllerIndicatorTHStock >::list_controller.
Referenced by GUIMainFrame::CheckUpdateRT().
void GUIMainController::UpdateGUIFromController | ( | ) |
only gui_mainframe->Resize(), but seems necessary when a new frame created
Definition at line 148 of file GUIMainController.cxx.
References gui_mainframe.
Referenced by MainControllerIndicatorTHStock::UpdateIndicator(), and MainControllerIndicatorTHStock::Validation().
|
private |
most general, may use a more specialized ? seems fine here really needed ?? seems use can be avoided...
or defined in ControllerBase if needed by a few
Definition at line 52 of file GUIMainController.h.
Referenced by GUIMainController().
|
private |
keep a pointer to StockManager from constructor.
all other controllers to have access to it.
No call to global variables from Controllers (still used by Views)
Definition at line 42 of file GUIMainController.h.
Referenced by GetStockManager(), and GUIMainController().
|
private |
direct link to an unique GUIMainFrame
Definition at line 46 of file GUIMainController.h.
Referenced by AddObserver_Message(), CreateMainControllerIndicatorTHStock(), GetFrame(), GUIMainController(), UpdateGUIFromController(), and ~GUIMainController().
|
private |
Observer for receiving messages from StockManager.
Definition at line 44 of file GUIMainController.h.
Referenced by GUIMainController().