10 #include "../src_cpp/StockManager.h"
11 #include "../src_cpp/SMSubject.h"
28 #ifdef DEBUG_CONT_FRAME
29 std::cout <<
"\n\tEntry Constructor GUIMainController" << std::endl;
30 std::cout <<
"this " <<
this << std::endl;
66 #ifdef DEBUG_CONT_FRAME
67 std::cout <<
"Destructor GUIMainController " << std::endl;
97 #ifdef DEBUG_CONT_FRAME
98 std::cout <<
"\n\tEntry GUIMainController::CreateMainControllerIndicatorTHStock() kmain " << kmain << std::endl;
99 std::cout <<
"this " <<
this << std::endl;
106 if ( kmain ==
false ) {
120 #ifdef DEBUG_CONT_FRAME
134 #ifdef DEBUG_CONT_FRAME
135 std::cout <<
"Entry GUIMainController::DeleteControllerIndicatorTHStock" << std::endl;
141 std::cout <<
"after delete control->GetFrame" << std::endl;
150 #ifdef DEBUG_CONT_FRAME
151 std::cout <<
"\n\tGUIMainController::UpdateGUIFromController " << std::endl;
165 #ifdef DEBUG_CONT_FRAME
166 std::cout <<
"Entry GUIMainController::Updated " << std::endl;
167 std::cout <<
"Message " << message[0] <<
"," << message[1] << std::endl;
168 std::cout <<
"Will only broadcast to child controller " << std::endl;
170 std::cout <<
"Entry GUIMainController::Updated " << std::endl;
177 (*it)->Updated( message );
198 #ifdef DEBUG_CONT_FRAME
199 std::cout <<
"\n\tEntry GUIMainController::AddObserver_Message() from StockManager " << std::endl;
200 std::cout <<
"message : " << message[0] <<
", " << message[1] << std::endl;
std::list< MainControllerIndicatorTHStock * > list_controller
list more convenient, remove if not shown ?, or insert
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.
TGCompositeFrame * GetFrame()
void UpdateRT(std::vector< std::string > &message)
set by thread of fstockmanger, register the message in frealtime2 and quit
void AddController(MainControllerIndicatorTHStock *control)
Common Function for dealing with the list, need a name, may call other controllers...
virtual void DeleteList(bool call_delete=true)
Iterative call for deleting child controller.
Independent frame, could be kMainFrame or kChild Frame which group one MainIndicatorFrame and THStock...
std::list< MainControllerIndicatorTHStock * >::iterator it_list
useful typedef for the class ( and derivatives !)
static StockManager * getInstance(std::string new_path=".")
Get a singleton instance.
SMSubject * GetSubject()
Get the subject instance.
void DeleteControllerIndicatorTHStock(MainControllerIndicatorTHStock *control)
Concrete class of an observer.
ControllerBase * fcurrent_controller
most general, may use a more specialized ? seems fine here really needed ?? seems use can be avoided...
virtual void attach(Observer *obs)
function for subject to register
MainControllerIndicatorTHStock * CreateMainControllerIndicatorTHStock(bool kmain=false)
Creates child controllers, contains Indicator+THStock(s).
GUIObserver * gui_observer
Observer for receiving messages from StockManager.
std::string GetPathData()
Main graphic frame for GUIStock application.
StockManager * fstockmanager
keep a pointer to StockManager from constructor.
void RemoveController(MainControllerIndicatorTHStock *control)
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
virtual ~GUIMainController()