All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AdvancedMonitoringDescriptor.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 /**
33  \file AdvancedMonitoringDescriptor.hpp
34  \brief Header of ...
35 
36  \author Aline LIBRES <aline.libres@gmail.com>
37  */
38 
39 #ifndef ADVANCEDMONITORINGDESCRIPTOR_HPP_
40 #define ADVANCEDMONITORINGDESCRIPTOR_HPP_
41 
43 #include <openfluid/dllexport.hpp>
44 
45 
46 namespace openfluid {
47 namespace fluidx {
48 
49 
50 // TODO refactor this for enable the possibility to have the same observer twice in the monitoring list
52 {
53  private:
54 
55  openfluid::fluidx::MonitoringDescriptor* mp_MonitoringDesc;
56 
57  public:
58 
61 
63 
64  void checkMonitoring() const;
65 
66  const std::list<openfluid::fluidx::ObserverDescriptor*>& getItems() const;
67 
68  /**
69  * @brief Returns the Descriptor of the Observer with ObserverID if is in the Monitoring descriptor
70  * @throw openfluid::base::OFException if this Observer is not in the Monitoring descriptor
71  */
73  std::string ObserverID) const;
74 
75  /**
76  * @brief Adds the Observer with ObserverID to the Monitoring descriptor
77  */
78  void addToObserverList(std::string ObserverID);
79 
80  /**
81  * @brief Removes the Observer with ObserverID from the Monitoring descriptor
82  * @throw openfluid::base::OFException if this Observer is not in the Monitoring descriptor
83  */
84  void removeFromObserverList(std::string ObserverID);
85 
86  /**
87  * @brief Replace existing observers with ObserversList
88  */
89  void setItems(
90  std::list<openfluid::fluidx::ObserverDescriptor*> ObserversList);
91 
92  // TODO to rename to match equivalent in AdvancedModelDescriptor
93  void moveItemTowardsTheBeginning(std::string ObserverID);
94 
95  // TODO to rename to match equivalent in AdvancedModelDescriptor
96  void moveItemTowardsTheEnd(std::string ObserverID);
97 
98  int getFirstIndex(const std::string& ID) const;
99 
100  std::vector<openfluid::ware::WareID_t> getOrderedIDs() const;
101 
102 
103 
104 };
105 
106 }
107 } //namespaces
108 #endif /* ADVANCEDMONITORINGDESCRIPTOR_HPP_ */
DLLEXPORT WareSetDescriptor< ObserverDescriptor > MonitoringDescriptor
Definition: MonitoringDescriptor.hpp:50
Definition: ObserverDescriptor.hpp:49
Definition: AdvancedMonitoringDescriptor.hpp:51
#define DLLEXPORT
Definition: dllexport.hpp:51