Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MessageVisitor.h
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * MessageVisitor.h
17  * The interface for the class which visits Message & MessageFields
18  * Copyright (C) 2011 Simon Newton
19  */
20 
21 #ifndef INCLUDE_OLA_MESSAGING_MESSAGEVISITOR_H_
22 #define INCLUDE_OLA_MESSAGING_MESSAGEVISITOR_H_
23 
24 #include <stdint.h>
25 
26 namespace ola {
27 namespace messaging {
28 
29 
30 class BoolMessageField;
31 class GroupMessageField;
32 class IPV4MessageField;
33 class StringMessageField;
34 class UIDMessageField;
35 
36 template <typename type>
37 class BasicMessageField;
38 
43  public:
44  virtual ~MessageVisitor() {}
45 
46  virtual void Visit(const BoolMessageField*) = 0;
47  virtual void Visit(const IPV4MessageField*) = 0;
48  virtual void Visit(const UIDMessageField*) = 0;
49  virtual void Visit(const StringMessageField*) = 0;
50  virtual void Visit(const BasicMessageField<uint8_t>*) = 0;
51  virtual void Visit(const BasicMessageField<uint16_t>*) = 0;
52  virtual void Visit(const BasicMessageField<uint32_t>*) = 0;
53  virtual void Visit(const BasicMessageField<int8_t>*) = 0;
54  virtual void Visit(const BasicMessageField<int16_t>*) = 0;
55  virtual void Visit(const BasicMessageField<int32_t>*) = 0;
56  virtual void Visit(const GroupMessageField*) = 0;
57  virtual void PostVisit(const GroupMessageField*) = 0;
58 };
59 } // namespace messaging
60 } // namespace ola
61 #endif // INCLUDE_OLA_MESSAGING_MESSAGEVISITOR_H_