Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
net_list_content.h
1 
2 /***************************************************************************
3  * net_list_content.h - Fawkes Network Config List Message
4  *
5  * Created: Fri Dec 07 14:52:59 2007
6  * Copyright 2006-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __CONFIG_NET_LIST_CONTENT_H_
25 #define __CONFIG_NET_LIST_CONTENT_H_
26 
27 #include <config/net_messages.h>
28 #include <config/config.h>
29 #include <netcomm/fawkes/message_content.h>
30 
31 namespace fawkes {
32 
33 class DynamicBuffer;
34 
36 {
37  public:
39  ConfigListContent(unsigned int component_id, unsigned int msg_id,
40  void *payload, size_t payload_size);
41  virtual ~ConfigListContent();
42 
43  void append_float(const char *path, float f, bool def_val = false);
44  void append_int(const char *path, int i, bool def_val = false);
45  void append_uint(const char *path, unsigned int u, bool def_val = false);
46  void append_bool(const char *path, bool b, bool def_val = false);
47  void append_string(const char *path, const char *s, bool def_val = false);
48  void append_comment(const char *path, const char *s, bool def_val = false);
50 
51  virtual void serialize();
52 
53  void reset_iterator();
54  bool has_next();
55  config_list_entity_header_t * next(size_t *size);
56 
57  private:
58  DynamicBuffer *config_list;
60 };
61 
62 } // end namespace fawkes
63 
64 #endif