tobicore  7.0.0
 All Classes Functions Variables Typedefs Enumerator Friends Groups Pages
IDMessage.hpp
1 /*
2  Copyright (C) 2009-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
3  Michele Tavella <michele.tavella@epfl.ch>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef IDMESSAGE_HPP
20 #define IDMESSAGE_HPP
21 
22 #include "IDTypes.hpp"
23 #include <tobicore/TCBlock.hpp>
24 
30 class IDMessage : public TCBlock {
31  friend class IDSerializerRapid;
32  public:
33  IDMessage(void);
34  IDMessage(IDMessage* const other);
35  IDMessage(IDFtype familyType, IDevent event);
36  virtual ~IDMessage(void);
37 
38  virtual void Copy(IDMessage* const other);
39  virtual std::string GetDescription(void) const;
40  virtual void SetDescription(const std::string& description);
41  virtual std::string GetSource(void) const;
42  virtual void SetSource(const std::string& description);
43  virtual IDFvalue GetFamily(void) const;
44  virtual bool SetFamilyType(const IDFtype type);
45  virtual bool SetFamilyType(const std::string& type);
46  virtual IDFtype GetFamilyType(void) const;
47  virtual void SetEvent(const IDevent event);
48  virtual IDevent GetEvent(void) const;
51  virtual void Dump(void) const;
52  static const IDFtype FamilyType(IDFvalue family);
53  private:
54  virtual void Init(void);
55 
56  public:
57  static const IDFtype FamilyUndef = -1;
58  static const IDFtype FamilyBiosig = 0;
59  static const IDFtype FamilyCustom = 1;
60 
61  static const IDevent EventNull = -1;
62 
63  static std::string TxtFamilyUndef;
64  static std::string TxtFamilyBiosig;
65  static std::string TxtFamilyCustom;
66  private:
67  IDFtype _familyType;
68  IDevent _event;
69  std::string _description;
70  std::string _source;
71 };
72 
73 #endif