EventDescriptor.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 
34 /**
35  @file EventDescriptor.hpp
36 
37  @author Jean-Christophe FABRE <jean-christophe.fabre@supagro.inra.fr>
38  */
39 
40 
41 #ifndef __OPENFLUID_FLUIDX_EVENTDESCRIPTOR_HPP__
42 #define __OPENFLUID_FLUIDX_EVENTDESCRIPTOR_HPP__
43 
44 #include <openfluid/dllexport.hpp>
45 #include <openfluid/core/TypeDefs.hpp>
46 #include <openfluid/core/Event.hpp>
47 
48 
49 namespace openfluid { namespace fluidx {
50 
51 
52 typedef unsigned long long EventID_t;
53 
54 
56 {
57  private:
58 
59  EventID_t m_ID;
60 
61  openfluid::core::UnitsClass_t m_UnitsClass;
62 
64 
65  openfluid::core::Event m_Event;
66 
67  static EventID_t m_NextID;
68 
69  static EventID_t assignID();
70 
71 
72  public:
73 
75 
76  EventDescriptor(const EventDescriptor& EvDesc);
77 
78  ~EventDescriptor();
79 
81  { return m_UnitID; };
82 
84  { m_UnitID = ID; };
85 
87  { return m_UnitsClass; };
88 
89  /**
90  @deprecated Since version 2.1.0. Use openfluid::fluidx::EventDescriptor::getUnitsClass() const instead
91  */
93  { return m_UnitsClass; };
94 
95  inline void setUnitsClass(const openfluid::core::UnitsClass_t& UClass)
96  { m_UnitsClass = UClass; }
97 
98  /**
99  @deprecated Since version 2.1.0.
100  Use openfluid::fluidx::EventDescriptor::setUnitsClass(const openfluid::core::UnitsClass_t&) instead
101  */
103  { m_UnitsClass = UClass; };
104 
106  { return m_Event; };
107 
108  inline const openfluid::core::Event& event() const
109  { return m_Event; };
110 
111  inline EventID_t getID() const
112  { return m_ID; };
113 
114 };
115 
116 
117 } } // namespaces
118 
119 
120 #endif /* __OPENFLUID_FLUIDX_EVENTDESCRIPTOR_HPP__ */
const openfluid::core::Event & event() const
Definition: EventDescriptor.hpp:108
openfluid::core::Event & event()
Definition: EventDescriptor.hpp:105
#define OPENFLUID_API
Definition: dllexport.hpp:87
#define OPENFLUID_DEPRECATED
Definition: deprecation.hpp:54
void setUnitsClass(const openfluid::core::UnitsClass_t &UClass)
Definition: EventDescriptor.hpp:95
Definition: ApplicationException.hpp:47
void setUnitClass(const openfluid::core::UnitsClass_t &UClass) OPENFLUID_DEPRECATED
Definition: EventDescriptor.hpp:102
std::string UnitsClass_t
Definition: TypeDefs.hpp:71
Definition: EventDescriptor.hpp:55
void setUnitID(openfluid::core::UnitID_t ID)
Definition: EventDescriptor.hpp:83
openfluid::core::UnitID_t getUnitID() const
Definition: EventDescriptor.hpp:80
unsigned int UnitID_t
Definition: TypeDefs.hpp:61
Definition: Event.hpp:59
unsigned long long EventID_t
Definition: EventDescriptor.hpp:52
const openfluid::core::UnitsClass_t getUnitClass() const OPENFLUID_DEPRECATED
Definition: EventDescriptor.hpp:92
const openfluid::core::UnitsClass_t getUnitsClass() const
Definition: EventDescriptor.hpp:86
EventID_t getID() const
Definition: EventDescriptor.hpp:111