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
configurablelist.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 __CONFIGURABLELIST_H_
26 #define __CONFIGURABLELIST_H_
27 
28 #include <vector>
29 #include "configurable.h"
30 
31 /**
32  * Establishes for some methods the notifications for registered Callbackable instances
33  * (use addCallbackable(...)).
34  * @warning Only the following methods are currently supported:
35  push_back(...), pop_back(), erase() and clear()!
36  * You can use iterators with the limitation to not delete or insert.
37  */
38 class ConfigurableList : public std::vector<Configurable*>, public BackCaller {
39  public:
41  virtual ~ConfigurableList();
42 
43  /**
44  * Indicates that the list has been modified, a Configurable instance was either added or removed.
45  */
47 
48  /**
49  * Indicates that the list is being deleted.
50  */
52 
53  void push_back(Configurable* const & configurable);
54  iterator erase(iterator pos);
55  void pop_back();
56  void clear();
57 };
58 
59 #endif /* __CONFIGURABLELIST_H_ */
void clear()
Definition: configurablelist.cpp:48
Establishes for some methods the notifications for registered Callbackable instances (use addCallback...
Definition: configurablelist.h:38
static const CallbackableType CALLBACK_CONFIGURABLE_LIST_MODIFIED
Indicates that the list has been modified, a Configurable instance was either added or removed...
Definition: configurablelist.h:46
unsigned long CallbackableType
Definition: backcaller.h:45
void pop_back()
Definition: configurablelist.cpp:42
void push_back(Configurable *const &configurable)
Definition: configurablelist.cpp:36
Abstact class for configurable objects.
Definition: configurable.h:81
ConfigurableList()
Definition: configurablelist.cpp:29
virtual ~ConfigurableList()
Definition: configurablelist.cpp:31
Class prototype which provides functions to handle callbackable classes.
Definition: backcaller.h:42
static const CallbackableType CALLBACK_CONFIGURABLE_LIST_BEING_DELETED
Indicates that the list is being deleted.
Definition: configurablelist.h:51
iterator erase(iterator pos)
Definition: configurablelist.cpp:54