Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
globaldatabase.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 
25 #ifndef __GLOBALDATABASE_H_
26 #define __GLOBALDATABASE_H_
27 
28 #include "agent.h"
29 #include "configurablelist.h"
30 
31 #ifndef NOCONFIGURATOR
32 namespace lpzrobots {
33  class ConfiguratorProxy;
34 }
35 #endif
36 
37 typedef std::vector<Agent*> AgentList;
38 
40  public:
42 
43  virtual ~GlobalDataBase();
44 
45  virtual AgentList& getAgents() = 0;
46 
47  template <typename Derived> struct dynamic_agent_caster {
48  Agent* operator()(Derived instance) { return dynamic_cast<Agent*>(instance); }
49  };
50 
51  /**
52  * Creates the Configurator and, if already exists, destroys the old one.
53  */
54  void createConfigurator();
55 
56  /**
57  * Destroys the Configurator if it was created.
58  */
59  void removeConfigurator();
60 
61  /**
62  * @return true if the Configurator is open and alive
63  */
64  bool isConfiguratorOpen();
65 
67 
68 #ifndef NOCONFIGURATOR
69  lpzrobots::ConfiguratorProxy * configurator;
70 #else
71  void* configurator;
72 #endif
73 
74 };
75 
76 #endif /* __GLOBALDATABASE_H_ */
GlobalDataBase()
Definition: globaldatabase.cpp:33
Establishes for some methods the notifications for registered Callbackable instances (use addCallback...
Definition: configurablelist.h:38
virtual AgentList & getAgents()=0
void createConfigurator()
Creates the Configurator and, if already exists, destroys the old one.
Definition: globaldatabase.cpp:39
virtual ~GlobalDataBase()
Definition: globaldatabase.cpp:37
The Agent contains a controller, a robot and a wiring, which connects robot and controller.
Definition: agent.h:52
Definition: globaldatabase.h:39
Definition: globaldatabase.h:47
ConfigurableList configs
Definition: globaldatabase.h:66
void removeConfigurator()
Destroys the Configurator if it was created.
Definition: globaldatabase.cpp:49
std::vector< Agent * > AgentList
Definition: globaldatabase.h:37
bool isConfiguratorOpen()
Definition: globaldatabase.cpp:45
lpzrobots::ConfiguratorProxy * configurator
Definition: globaldatabase.h:69
Agent * operator()(Derived instance)
Definition: globaldatabase.h:48