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
MainControllerIndicatorTHStock Class Reference

Controller for a dual frame containing Indicator+THStock(s). More...

#include <MainControllerIndicatorTHStock.h>

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

Public Member Functions

 MainControllerIndicatorTHStock (GUIMainController *parent_control, std::string name, TGCompositeFrame *associated_frame, bool b_mainframe)
 Constructor. More...
 
virtual ~MainControllerIndicatorTHStock ()
 
MainIndicatorTHStockFrameGetFrame () const
 
GUIMainControllerGetGUIMainController () const
 
ControllerIndicatorTHStockGetCurrentController () const
 
StockManagerGetStockManager () const
 
void AddCouple_Indicator_THStock (std::string frame_name)
 Create a new sub-controller and update views for adding a new frame Does not add any data, done later by AddData. More...
 
void DeleteIndicatorTHstock ()
 Delete all couples of frames and thstocks Call by MainControllerIndicatorStock::CloseWindow() More...
 
void Validation (std::string fullname)
 Load stock or indicator after pressing the Validation button. More...
 
virtual void Updated (std::vector< std::string > &message)
 Call by parent controller, when a new message is available. More...
 
void GetSelected (ControllerIndicatorTHStock *child_controller)
 receive indirectly the IndicatorFrame Selected, can set the current_frame ( can get pad also ) More...
 
void UpdateIndicator (ControllerIndicatorTHStock *child_controller, std::string mode)
 called by controller child for some tasks child cannot do. More...
 
void Update ()
 coming from StockManager, through observer pattern no should come from gui_maincontroller now More...
 
- Public Member Functions inherited from ControllerFrame< ControllerIndicatorTHStock >
 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< ControllerIndicatorTHStock >
 ListController ()
 
virtual ~ListController ()
 
void AddController (ControllerIndicatorTHStock *control)
 Common Function for dealing with the list, need a name, may call other controllers... More...
 
void RemoveController (ControllerIndicatorTHStock *control)
 
ControllerIndicatorTHStockGetController (std::string name)
 
ControllerIndicatorTHStockGetFirstController ()
 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

MainIndicatorTHStockFramefindic_thstock
 
ControllerIndicatorTHStockfcurrent_controller
 
GUIMainControllermyparent_controller
 
bool kMainFrame
 link to StockManager, singleton, initialized in constructor More...
 

Additional Inherited Members

- Protected Types inherited from ListController< ControllerIndicatorTHStock >
typedef std::list
< ControllerIndicatorTHStock * >
::iterator 
it_list
 useful typedef for the class ( and derivatives !) More...
 
- Protected Attributes inherited from ListController< ControllerIndicatorTHStock >
std::list
< ControllerIndicatorTHStock * > 
list_controller
 list more convenient, remove if not shown ?, or insert More...
 

Detailed Description

Controller for a dual frame containing Indicator+THStock(s).

Should be flexible and allow only THStock ( not real interest at the moment ) Own EventInfo and status as common for all THStocks

Contains a list of sub-controller ControllerIndicatorTHStock for dealing with synchronization: 1 Indicator + 1 THStock

Definition at line 37 of file MainControllerIndicatorTHStock.h.

Constructor & Destructor Documentation

MainControllerIndicatorTHStock::MainControllerIndicatorTHStock ( GUIMainController parent_control,
std::string  name,
TGCompositeFrame *  associated_frame,
bool  b_mainframe 
)

Constructor.

Parameters
parent_control: parent_controller
name: name of the controller
associated_frame: needed the parent frame

Definition at line 30 of file MainControllerIndicatorTHStock.cxx.

References fcurrent_controller, findic_thstock, ControllerBase::GetName(), kMainFrame, and myparent_controller.

Here is the call graph for this function:

MainControllerIndicatorTHStock::~MainControllerIndicatorTHStock ( )
virtual

Definition at line 91 of file MainControllerIndicatorTHStock.cxx.

References ListController< ControllerIndicatorTHStock >::DeleteList().

Here is the call graph for this function:

Member Function Documentation

void MainControllerIndicatorTHStock::AddCouple_Indicator_THStock ( std::string  frame_name)

Create a new sub-controller and update views for adding a new frame Does not add any data, done later by AddData.

Parameters
frame_name: name of the new frame

Definition at line 113 of file MainControllerIndicatorTHStock.cxx.

References ListController< ControllerIndicatorTHStock >::AddController(), fcurrent_controller, findic_thstock, GetFrame(), ControllerIndicatorTHStock::GetIndicatorFrame(), MainIndicatorTHStockFrame::GetIndicatorFrame(), ControllerIndicatorTHStock::GetTHStockFrame(), and MainIndicatorTHStockFrame::GetTHStockFrame().

Referenced by Validation().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainControllerIndicatorTHStock::DeleteIndicatorTHstock ( )

Delete all couples of frames and thstocks Call by MainControllerIndicatorStock::CloseWindow()

Definition at line 171 of file MainControllerIndicatorTHStock.cxx.

References GUIMainController::DeleteControllerIndicatorTHStock(), and GetGUIMainController().

Referenced by MainIndicatorTHStockFrame::CloseWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

ControllerIndicatorTHStock* MainControllerIndicatorTHStock::GetCurrentController ( ) const
inline

Definition at line 84 of file MainControllerIndicatorTHStock.h.

References fcurrent_controller.

Referenced by Validation().

Here is the caller graph for this function:

MainIndicatorTHStockFrame* MainControllerIndicatorTHStock::GetFrame ( ) const
inline

Definition at line 78 of file MainControllerIndicatorTHStock.h.

References findic_thstock.

Referenced by AddCouple_Indicator_THStock(), ControllerIndicatorTHStock::ControllerIndicatorTHStock(), and Validation().

Here is the caller graph for this function:

GUIMainController* MainControllerIndicatorTHStock::GetGUIMainController ( ) const
inline

Definition at line 79 of file MainControllerIndicatorTHStock.h.

References myparent_controller.

Referenced by DeleteIndicatorTHstock().

Here is the caller graph for this function:

void MainControllerIndicatorTHStock::GetSelected ( ControllerIndicatorTHStock child_controller)

receive indirectly the IndicatorFrame Selected, can set the current_frame ( can get pad also )

Definition at line 488 of file MainControllerIndicatorTHStock.cxx.

References fcurrent_controller, findic_thstock, ControllerBase::GetName(), FullName::GetNameStock(), FullName::GetTimeScale(), MainIndicatorTHStockFrame::SetTextResearch(), and MainIndicatorTHStockFrame::SetTimeScale().

Here is the call graph for this function:

StockManager * MainControllerIndicatorTHStock::GetStockManager ( ) const

Definition at line 104 of file MainControllerIndicatorTHStock.cxx.

References GUIMainController::GetStockManager(), and myparent_controller.

Referenced by ControllerIndicatorTHStock::UpdateIndicator(), and Validation().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainControllerIndicatorTHStock::Update ( )

coming from StockManager, through observer pattern no should come from gui_maincontroller now

Definition at line 571 of file MainControllerIndicatorTHStock.cxx.

References fcurrent_controller, and ControllerIndicatorTHStock::UpdateFrames().

Here is the call graph for this function:

void MainControllerIndicatorTHStock::Updated ( std::vector< std::string > &  message)
virtual

Call by parent controller, when a new message is available.


overload a pure virtual function

Implements ControllerBase.

Definition at line 465 of file MainControllerIndicatorTHStock.cxx.

References ListController< ControllerIndicatorTHStock >::list_controller.

void MainControllerIndicatorTHStock::UpdateIndicator ( ControllerIndicatorTHStock child_controller,
std::string  mode 
)
void MainControllerIndicatorTHStock::Validation ( std::string  fullname)

Load stock or indicator after pressing the Validation button.

need access to fstockmanager, should be in GUIMainController only ?? or retrieve from global need to call GUIMainController anyway, if need to create a independent MainControlletIndactorTHStock

Parameters
fullname: string containing all infos

BUG here ////////////////////// AddStock Dangerous, no check if existed, now exception working AddStock should make all the job, independent before if newStock or not... more reusable Done with StockManager::Merge called by AddStock do not throw exception

Definition at line 196 of file MainControllerIndicatorTHStock.cxx.

References AddCouple_Indicator_THStock(), ControllerIndicatorTHStock::AddData(), StockManager::AddStock(), GUIMainController::CreateMainControllerIndicatorTHStock(), DAY, fcurrent_controller, StockManager::Find(), findic_thstock, Utils::firstlast_dates::first, Utils::get_fldate_default(), GetCurrentController(), GetFrame(), FullName::GetIndicator(), FullName::GetNameStock(), FullName::GetParams(), Utils::GetPathData(), GetStockManager(), FullName::GetTimeScale(), INST, Utils::firstlast_dates::last, StockManager::Load(), FrameName::MakeFrameName(), myparent_controller, StockManager::PrintMap(), Stock::PrintMapChrono(), Stock::Read_HeaderCSV(), MainIndicatorTHStockFrame::ResetEntries(), Indicator::StockCSV, Indicator::StockInst, MainIndicatorTHStockFrame::ToAddCanvas(), MainIndicatorTHStockFrame::ToMakeMain(), GUIMainController::UpdateGUIFromController(), and StockException::what().

Referenced by MainIndicatorTHStockFrame::HandleButtons().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

ControllerIndicatorTHStock* MainControllerIndicatorTHStock::fcurrent_controller
private
MainIndicatorTHStockFrame* MainControllerIndicatorTHStock::findic_thstock
private
bool MainControllerIndicatorTHStock::kMainFrame
private

link to StockManager, singleton, initialized in constructor

indicates if it is a MainFrame (independent frame) or not

Definition at line 56 of file MainControllerIndicatorTHStock.h.

Referenced by MainControllerIndicatorTHStock().

GUIMainController* MainControllerIndicatorTHStock::myparent_controller
private

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