Fawkes API Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * net_list_content.h - Fawkes Network Config List Message 00004 * 00005 * Created: Fri Dec 07 14:52:59 2007 00006 * Copyright 2006-2007 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __CONFIG_NET_LIST_CONTENT_H_ 00025 #define __CONFIG_NET_LIST_CONTENT_H_ 00026 00027 #include <config/net_messages.h> 00028 #include <config/config.h> 00029 #include <netcomm/fawkes/message_content.h> 00030 00031 namespace fawkes { 00032 00033 class DynamicBuffer; 00034 00035 class ConfigListContent : public FawkesNetworkMessageContent 00036 { 00037 public: 00038 ConfigListContent(); 00039 ConfigListContent(unsigned int component_id, unsigned int msg_id, 00040 void *payload, size_t payload_size); 00041 virtual ~ConfigListContent(); 00042 00043 void append_float(const char *path, float f, bool def_val = false); 00044 void append_int(const char *path, int i, bool def_val = false); 00045 void append_uint(const char *path, unsigned int u, bool def_val = false); 00046 void append_bool(const char *path, bool b, bool def_val = false); 00047 void append_string(const char *path, const char *s, bool def_val = false); 00048 void append_comment(const char *path, const char *s, bool def_val = false); 00049 void append(Configuration::ValueIterator *i); 00050 00051 virtual void serialize(); 00052 00053 void reset_iterator(); 00054 bool has_next(); 00055 config_list_entity_header_t * next(size_t *size); 00056 00057 private: 00058 DynamicBuffer *config_list; 00059 config_list_msg_t msg; 00060 }; 00061 00062 } // end namespace fawkes 00063 00064 #endif