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 Types | Private Member Functions | Private Attributes
ControllerIndicatorTHStock Class Reference

Final controller class, does not derive from ListController. More...

#include <ControllerIndicatorTHStock.h>

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

Public Member Functions

 ControllerIndicatorTHStock (MainControllerIndicatorTHStock *parent, TGCompositeFrame *mother_frame_indic, TGCompositeFrame *mother_frame_thstock, std::string frame_name)
 
virtual ~ControllerIndicatorTHStock ()
 
IndicatorFrameGetIndicatorFrame () const
 
void SetIndicatorFrame (IndicatorFrame *findic)
 
THStockFrameGetTHStockFrame () const
 
void SetTHStockFrame (THStockFrame *fthstock)
 
void AddData (std::string fullname)
 Used when a new ListData is added, need SM access here, or in parent... More...
 
void GetSelected (int pad_number)
 
void UpdateIndicator (std::string mode, std::string fullname)
 UpdateIndicator, call by IndicatorFrame. More...
 
void ModifyColorIndic (std::string fullname, unsigned long color)
 
void PrintVector ()
 Print the Content of the vector vec_name_data, for debugging. More...
 
void UpdateFrames ()
 keep only for updating THStockFrame for the moment, how done by Indicator ? More...
 
virtual void Updated (std::vector< std::string > &message)
 receive an update from observer pattern, from StockManager More...
 
- Public Member Functions inherited from ControllerFrame< NullType >
 ControllerFrame ()
 
 ControllerFrame (ControllerBase *parent, std::string name="")
 
virtual ~ControllerFrame ()
 
virtual void DeleteList (bool call_delete=true)
 
- Public Member Functions inherited from ControllerBase
 ControllerBase ()
 
 ControllerBase (ControllerBase *parent, std::string cont_name)
 
virtual ~ControllerBase ()
 
std::string GetName () const
 
ControllerBaseGetParentController ()
 

Private Types

typedef std::list< std::string >
::iterator 
it_list
 define iterator and const iterator for loop More...
 
typedef std::list< std::string >
::const_iterator 
it_clist
 
typedef std::vector< std::list
< std::string > >::iterator 
it_vec
 
typedef std::vector< std::list
< std::string >
>::const_iterator 
it_cvec
 

Private Member Functions

bool IsPresent (std::string fullname, unsigned int i) const
 check if fullname is present in the pad number i More...
 
std::list< std::string > * GetList (unsigned int nb_pad)
 return the list of name of the pad number nb_pad. More...
 
bool NeedToUpdate (std::string stockname, ETime tmscl) const
 check if the size of ldata and object match, or if need an update. More...
 
int AddDataToVecNameData (std::string fullname, unsigned int nb_pad=0)
 add the name of the new data in the pad nb_pad. More...
 
unsigned int GetPadNumber (std::string fullname) const
 want the index of the vector containing the corresponding fullname, i.e. More...
 

Private Attributes

IndicatorFramefindic_frame
 pointer to the frame and indicator. More...
 
THStockFramefthstock_frame
 pointer to the frame More...
 
MainControllerIndicatorTHStockmyparent_controller
 before base was working, test if explicit, seems necessary depending on the function called More...
 
std::vector< std::list
< std::string > > 
vec_name_data
 add a list of loaded data, use only name ( fullname ). More...
 

Detailed Description

Final controller class, does not derive from ListController.

\ Controller for an unique couple Indicator / THStockFrame

good point simple to know if loaded in the controller, and not in the view \ keep a list vec_name_data ( of all loaded ListDataStock and their pad number )\

Do not care if show or hidden, this is done by the view, may be good \ Less to do in view ( problem of pads...)

Definition at line 48 of file ControllerIndicatorTHStock.h.

Member Typedef Documentation

typedef std::list<std::string>::const_iterator ControllerIndicatorTHStock::it_clist
private

Definition at line 53 of file ControllerIndicatorTHStock.h.

typedef std::vector< std::list<std::string> >::const_iterator ControllerIndicatorTHStock::it_cvec
private

Definition at line 55 of file ControllerIndicatorTHStock.h.

typedef std::list<std::string>::iterator ControllerIndicatorTHStock::it_list
private

define iterator and const iterator for loop

Definition at line 52 of file ControllerIndicatorTHStock.h.

typedef std::vector< std::list<std::string> >::iterator ControllerIndicatorTHStock::it_vec
private

Definition at line 54 of file ControllerIndicatorTHStock.h.

Constructor & Destructor Documentation

ControllerIndicatorTHStock::ControllerIndicatorTHStock ( MainControllerIndicatorTHStock parent,
TGCompositeFrame *  mother_frame_indic,
TGCompositeFrame *  mother_frame_thstock,
std::string  frame_name 
)
ControllerIndicatorTHStock::~ControllerIndicatorTHStock ( )
virtual

Definition at line 69 of file ControllerIndicatorTHStock.cxx.

References myparent_controller, and vec_name_data.

Member Function Documentation

void ControllerIndicatorTHStock::AddData ( std::string  fullname)
int ControllerIndicatorTHStock::AddDataToVecNameData ( std::string  fullname,
unsigned int  nb_pad = 0 
)
private

add the name of the new data in the pad nb_pad.

Parameters
nb_pad: insert in this pad number, need default pad ? 0 will creates a new one ?
fullname: insert the fullname in the list
Returns
status 0 is ok, 1 error

Definition at line 188 of file ControllerIndicatorTHStock.cxx.

References GetList(), and vec_name_data.

Referenced by AddData().

Here is the call graph for this function:

Here is the caller graph for this function:

IndicatorFrame* ControllerIndicatorTHStock::GetIndicatorFrame ( ) const
inline

Definition at line 101 of file ControllerIndicatorTHStock.h.

References findic_frame.

Referenced by MainControllerIndicatorTHStock::AddCouple_Indicator_THStock(), and MainControllerIndicatorTHStock::UpdateIndicator().

Here is the caller graph for this function:

std::list< std::string > * ControllerIndicatorTHStock::GetList ( unsigned int  nb_pad)
private

return the list of name of the pad number nb_pad.

creates a new one if not existing

Definition at line 96 of file ControllerIndicatorTHStock.cxx.

References vec_name_data.

Referenced by AddDataToVecNameData().

Here is the caller graph for this function:

unsigned int ControllerIndicatorTHStock::GetPadNumber ( std::string  fullname) const
private

want the index of the vector containing the corresponding fullname, i.e.

the pad number

Definition at line 213 of file ControllerIndicatorTHStock.cxx.

References IsPresent(), and vec_name_data.

Referenced by ModifyColorIndic(), and UpdateIndicator().

Here is the call graph for this function:

Here is the caller graph for this function:

void ControllerIndicatorTHStock::GetSelected ( int  pad_number)

Definition at line 307 of file ControllerIndicatorTHStock.cxx.

References ControllerBase::GetParentController().

Referenced by THStockFrame::GetSignalSelected().

Here is the call graph for this function:

Here is the caller graph for this function:

THStockFrame* ControllerIndicatorTHStock::GetTHStockFrame ( ) const
inline
bool ControllerIndicatorTHStock::IsPresent ( std::string  fullname,
unsigned int  i 
) const
private

check if fullname is present in the pad number i

Definition at line 85 of file ControllerIndicatorTHStock.cxx.

References vec_name_data.

Referenced by GetPadNumber().

Here is the caller graph for this function:

void ControllerIndicatorTHStock::ModifyColorIndic ( std::string  fullname,
unsigned long  color 
)

Definition at line 436 of file ControllerIndicatorTHStock.cxx.

References fthstock_frame, THStockFrame::GetECanvas(), FullName::GetFrameName(), GetPadNumber(), and CanvasStock::SetColor().

Referenced by IndicatorFrame::HandleButtons().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ControllerIndicatorTHStock::NeedToUpdate ( std::string  stockname,
ETime  tmscl 
) const
private

check if the size of ldata and object match, or if need an update.

update done by the caller

Definition at line 124 of file ControllerIndicatorTHStock.cxx.

References FullName::GetNameStock().

Referenced by Updated().

Here is the call graph for this function:

Here is the caller graph for this function:

void ControllerIndicatorTHStock::PrintVector ( )

Print the Content of the vector vec_name_data, for debugging.

Definition at line 455 of file ControllerIndicatorTHStock.cxx.

References vec_name_data.

Referenced by AddData(), Updated(), and UpdateIndicator().

Here is the caller graph for this function:

void ControllerIndicatorTHStock::SetIndicatorFrame ( IndicatorFrame findic)
inline

Definition at line 102 of file ControllerIndicatorTHStock.h.

References findic_frame.

Referenced by MainControllerIndicatorTHStock::UpdateIndicator().

Here is the caller graph for this function:

void ControllerIndicatorTHStock::SetTHStockFrame ( THStockFrame fthstock)
inline

Definition at line 104 of file ControllerIndicatorTHStock.h.

References fthstock_frame.

Referenced by MainControllerIndicatorTHStock::UpdateIndicator().

Here is the caller graph for this function:

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

receive an update from observer pattern, from StockManager

Implements ControllerBase.

Definition at line 468 of file ControllerIndicatorTHStock.cxx.

References ControllerBase::GetName(), INST, NeedToUpdate(), PrintVector(), and UpdateFrames().

Here is the call graph for this function:

void ControllerIndicatorTHStock::UpdateFrames ( )

keep only for updating THStockFrame for the moment, how done by Indicator ?

only THStockFrame, how is done by Indicator

Definition at line 517 of file ControllerIndicatorTHStock.cxx.

References THStockFrame::GetECanvas(), GetTHStockFrame(), and CanvasStock::UpdateTHStock().

Referenced by AddData(), MainControllerIndicatorTHStock::Update(), and Updated().

Here is the call graph for this function:

Here is the caller graph for this function:

void ControllerIndicatorTHStock::UpdateIndicator ( std::string  mode,
std::string  fullname 
)

UpdateIndicator, call by IndicatorFrame.

First link between Frame and Controller.\ Can only make a subpart of the function here : only one thstock one indicator.\

should call functions of MainControllerIndicatorTHStock at least if a resizing of the main_frames are needed.

important to get npad from the signal, best solution ?? controller could query from the name, only one indicator/thstock here now avoid to maintain npad in indicator frame label in synchronization much later: goal is to avoid nb_pad in the signal ?

Parameters
mode: HIDE, DELETE, HIDE_ALL, DELETE_ALL, SHOW, SHOW_ALL
fullname
nb_pad

Definition at line 352 of file ControllerIndicatorTHStock.cxx.

References StockManager::DeleteListData(), fthstock_frame, THStockFrame::GetECanvas(), FullName::GetFrameName(), GetPadNumber(), MainControllerIndicatorTHStock::GetStockManager(), CanvasStock::HideListData(), myparent_controller, PrintVector(), CanvasStock::ShowListData(), and MainControllerIndicatorTHStock::UpdateIndicator().

Referenced by IndicatorFrame::HandleButtons().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

IndicatorFrame* ControllerIndicatorTHStock::findic_frame
private

pointer to the frame and indicator.

only one associated, could be const no need of current

Definition at line 60 of file ControllerIndicatorTHStock.h.

Referenced by AddData(), ControllerIndicatorTHStock(), GetIndicatorFrame(), and SetIndicatorFrame().

THStockFrame* ControllerIndicatorTHStock::fthstock_frame
private
MainControllerIndicatorTHStock* ControllerIndicatorTHStock::myparent_controller
private

before base was working, test if explicit, seems necessary depending on the function called

Definition at line 66 of file ControllerIndicatorTHStock.h.

Referenced by ControllerIndicatorTHStock(), UpdateIndicator(), and ~ControllerIndicatorTHStock().

std::vector< std::list<std::string> > ControllerIndicatorTHStock::vec_name_data
private

add a list of loaded data, use only name ( fullname ).

Could be other data (??) easier with map ? but need rename for a map... vector relates to pad number index, list to the data there

Definition at line 72 of file ControllerIndicatorTHStock.h.

Referenced by AddDataToVecNameData(), GetList(), GetPadNumber(), IsPresent(), PrintVector(), and ~ControllerIndicatorTHStock().


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