Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringMessageBuilder.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  * StringMessageBuilder.h
17  * The interface for the class which builds Message objects from a vector of
18  * strings.
19  * Copyright (C) 2011 Simon Newton
20  */
21 
22 #ifndef INCLUDE_OLA_MESSAGING_STRINGMESSAGEBUILDER_H_
23 #define INCLUDE_OLA_MESSAGING_STRINGMESSAGEBUILDER_H_
24 
25 #include <ola/messaging/DescriptorVisitor.h>
26 #include <string>
27 #include <vector>
28 
29 namespace ola {
30 namespace messaging {
31 
32 
33 using std::string;
34 using std::vector;
35 
36 
41  public:
42  explicit StringMessageBuilder(const vector<string> &input)
43  : m_input(input) {
44  }
45  ~StringMessageBuilderVisitor() {}
46 
47  void Visit(const BoolFieldDescriptor*);
48  void Visit(const IPV4FieldDescriptor*);
49  void Visit(const UIDFieldDescriptor*);
50  void Visit(const StringFieldDescriptor*);
51  void Visit(const IntegerFieldDescriptor<uint8_t>*);
52  void Visit(const IntegerFieldDescriptor<uint16_t>*);
53  void Visit(const IntegerFieldDescriptor<uint32_t>*);
54  void Visit(const IntegerFieldDescriptor<int8_t>*);
55  void Visit(const IntegerFieldDescriptor<int16_t>*);
56  void Visit(const IntegerFieldDescriptor<int32_t>*);
57  void Visit(const FieldDescriptorGroup*);
58  void PostVisit(const FieldDescriptorGroup*);
59 
60  private:
61  vector<string> m_input;
62 };
63 } // namespace messaging
64 } // namespace ola
65 #endif // INCLUDE_OLA_MESSAGING_STRINGMESSAGEBUILDER_H_