26 #ifndef _CONTROLLER_BASE_H_
27 #define _CONTROLLER_BASE_H_
50 #ifdef DEBUG_CONT_FRAME
51 std::cout <<
"ControllerBase constructor" << std::endl;
55 #ifdef DEBUG_CONT_FRAME
56 std::cout <<
"ControllerBase constructor with parent " << parent << std::endl;
60 #ifdef DEBUG_CONT_FRAME
61 std::cout <<
"controller base destructor " << std::endl;
78 virtual void Updated( std::vector<std::string> & ) =0;
110 typedef typename std::list<T *>::iterator
it_list;
123 #ifdef DEBUG_CONT_FRAME
124 std::cout <<
"list controller constructor" << std::endl;
129 #ifdef DEBUG_CONT_FRAME
130 std::cout <<
"list controller destructor " << std::endl;
140 #ifdef DEBUG_CONT_FRAME
141 std::cout <<
"Entry ListController<T>::RemoveController" << std::endl;
142 std::cout <<
"size Controller " <<
list_controller.size() << std::endl;
145 if ( (*it) == control ) {
146 #ifdef DEBUG_CONT_FRAME
147 std::cout <<
"found controller to remove " << std::endl;
153 std::cout <<
"\n\t Cannot remove from the controller \n" << std::endl;
164 #ifdef DEBUG_CONT_FRAME
165 std::cout <<
"ListController<T>::DeleteList " <<
list_controller.size() << std::endl;
173 std::cout <<
"Will DeleteList in ListController " << (*it)->GetName() << std::endl;
181 std::cout <<
"End Controller::DeleteList " << std::endl;
213 #ifdef DEBUG_CONT_FRAME
214 std::cout <<
"ControllerFrame constructor default" << std::endl;
219 #ifdef DEBUG_CONT_FRAME
220 std::cout <<
"ControllerFrame constructor" << std::endl;
224 #ifdef DEBUG_CONT_FRAME
225 std::cout <<
"ControllerFrame destructor" << std::endl;
254 #ifdef DEBUG_CONT_FRAME
255 std::cout <<
"ControllerFrame<NullType> constructor default" << std::endl;
260 #ifdef DEBUG_CONT_FRAME
261 std::cout <<
"ControllerFrame<NullType> constructor" << std::endl;
265 #ifdef DEBUG_CONT_FRAME
266 std::cout <<
"ControllerFrame<NullType> destructor" << std::endl;
272 #ifdef DEBUG_CONT_FRAME
273 std::cout <<
"ControllerFrame<NullType>::DeleteList" << std::endl;
T * GetController(std::string name)
std::list< T * > list_controller
list more convenient, remove if not shown ?, or insert
virtual void DeleteList(bool call_delete=true)
ControllerFrame(ControllerBase *parent, std::string name="")
ControllerBase * fparent_controller
parent controller 0 by default
virtual ~ControllerFrame()
void AddController(T *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.
virtual unsigned int GetSizeListController() const
std::list< T * >::iterator it_list
useful typedef for the class ( and derivatives !)
virtual void Updated(std::vector< std::string > &)=0
virtual ~ListController()
T * GetFirstController()
get the first controller in list, useful after a delete
std::string GetName() const
ControllerBase * GetParentController()
virtual ~ControllerFrame()
void RemoveController(T *control)
ControllerFrame(ControllerBase *parent, std::string name="")
ControllerBase(ControllerBase *parent, std::string cont_name)
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 ~ControllerBase()
std::string name
name Controller_X, initialized to "" by default