ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes
GUIMainController Class Reference

Main controller of the application, linked to the view GUIMainFrame. More...

#include <GUIMainController.h>

Inheritance diagram for GUIMainController:
Inheritance graph
[legend]
Collaboration diagram for GUIMainController:
Collaboration graph
[legend]

Public Member Functions

 GUIMainController ()
 Constructor. More...
 
virtual ~GUIMainController ()
 
virtual GUIMainControllerGetParentController ()
 overwrite the ControllerBase function, no parent for this one, this or 0 from ControllerBase More...
 
GUIMainFrameGetFrame () const
 
StockManagerGetStockManager () const
 needed here More...
 
MainControllerIndicatorTHStockCreateMainControllerIndicatorTHStock (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
 
ControllerBaseGetParentController ()
 
- 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)
 
MainControllerIndicatorTHStockGetController (std::string name)
 
MainControllerIndicatorTHStockGetFirstController ()
 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

StockManagerfstockmanager
 keep a pointer to StockManager from constructor. More...
 
GUIObservergui_observer
 Observer for receiving messages from StockManager. More...
 
GUIMainFramegui_mainframe
 direct link to an unique GUIMainFrame More...
 
ControllerBasefcurrent_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

GUIMainController::GUIMainController ( )
GUIMainController::~GUIMainController ( )
virtual

Definition at line 64 of file GUIMainController.cxx.

References ListController< MainControllerIndicatorTHStock >::DeleteList(), and gui_mainframe.

Here is the call graph for this function:

Member Function Documentation

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
kmain: bool, default false is not an independent frame
Returns
: new created controller, associate fcurrent_controller to it

Definition at line 95 of file GUIMainController.cxx.

References ListController< MainControllerIndicatorTHStock >::AddController(), GUIMainFrame::GetFrame(), and gui_mainframe.

Referenced by GUIMainController(), and MainControllerIndicatorTHStock::Validation().

Here is the call graph for this function:

Here is the caller graph for this function:

void GUIMainController::DeleteControllerIndicatorTHStock ( MainControllerIndicatorTHStock control)

Definition at line 132 of file GUIMainController.cxx.

References ListController< MainControllerIndicatorTHStock >::RemoveController().

Referenced by MainControllerIndicatorTHStock::DeleteIndicatorTHstock().

Here is the call graph for this function:

Here is the caller graph for this function:

GUIMainFrame* GUIMainController::GetFrame ( ) const
inline

Definition at line 63 of file GUIMainController.h.

References gui_mainframe.

virtual GUIMainController* GUIMainController::GetParentController ( )
inlinevirtual

overwrite the ControllerBase function, no parent for this one, this or 0 from ControllerBase

Definition at line 62 of file GUIMainController.h.

StockManager* GUIMainController::GetStockManager ( ) const
inline

needed here

Definition at line 66 of file GUIMainController.h.

References fstockmanager.

Referenced by MainControllerIndicatorTHStock::GetStockManager().

Here is the caller graph for this function:

void GUIMainController::Updated ( std::vector< std::string > &  message)
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().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

Field Documentation

ControllerBase* GUIMainController::fcurrent_controller
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().

StockManager* GUIMainController::fstockmanager
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().

GUIMainFrame* GUIMainController::gui_mainframe
private
GUIObserver* GUIMainController::gui_observer
private

Observer for receiving messages from StockManager.

Definition at line 44 of file GUIMainController.h.

Referenced by GUIMainController().


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