Fawkes API  Fawkes Development Version
types.h
1 
2 /***************************************************************************
3  * types.h - Field types used in the intefaces and the messages
4  *
5  * Created: Fri Jul 16 17:35:43 2009
6  * Copyright 2006 Tim Niemueller [www.niemueller.de]
7  * 2009 Daniel Beck
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef _INTERFACE_TYPES_H__
26 #define _INTERFACE_TYPES_H__
27 
28 #include <sys/types.h>
29 
30 #include <map>
31 #include <string>
32 
33 namespace fawkes {
34 
35 /** Interface field type*/
36 typedef enum {
37  IFT_BOOL, /**< boolean field */
38  IFT_INT8, /**< 8 bit integer field */
39  IFT_UINT8, /**< 8 bit unsigned integer field */
40  IFT_INT16, /**< 16 bit integer field */
41  IFT_UINT16, /**< 16 bit unsigned integer field */
42  IFT_INT32, /**< 32 bit integer field */
43  IFT_UINT32, /**< 32 bit unsigned integer field */
44  IFT_INT64, /**< 64 bit integer field */
45  IFT_UINT64, /**< 64 bit unsigned integer field */
46  IFT_FLOAT, /**< float field */
47  IFT_DOUBLE, /**< double field */
48  IFT_STRING, /**< string field */
49  IFT_BYTE, /**< byte field, alias for uint8 */
50  IFT_ENUM /**< field with interface specific enum type */
52 
53 /** Map of enum integer to string values. */
54 typedef std::map<int, std::string> interface_enum_map_t;
55 
56 /** Interface field info list */
58 {
59  interface_fieldtype_t type; /**< type of this field */
60  const char * enumtype; /**< text representation of enum type */
61  const char * name; /**< Name of this field */
62  size_t length; /**< Length of field (array, string) */
63  void * value; /**< Current value of this field */
64  const interface_enum_map_t *enum_map; /**< Map of possible enum values */
65  interface_fieldinfo_t * next; /**< next field, NULL if last */
66 };
67 
68 } // namespace fawkes
69 
70 #endif /* INTERFACE_TYPES_H___ */
fawkes::IFT_UINT8
8 bit unsigned integer field
Definition: types.h:50
fawkes::interface_fieldinfo_t::next
interface_fieldinfo_t * next
next field, NULL if last
Definition: types.h:70
fawkes::interface_fieldtype_t
interface_fieldtype_t
Interface field type.
Definition: types.h:41
fawkes::IFT_UINT64
64 bit unsigned integer field
Definition: types.h:56
fawkes::IFT_INT8
8 bit integer field
Definition: types.h:49
fawkes::IFT_BOOL
boolean field
Definition: types.h:48
fawkes::IFT_FLOAT
float field
Definition: types.h:57
fawkes::IFT_ENUM
field with interface specific enum type
Definition: types.h:61
fawkes::IFT_UINT16
16 bit unsigned integer field
Definition: types.h:52
fawkes::IFT_UINT32
32 bit unsigned integer field
Definition: types.h:54
fawkes::IFT_INT32
32 bit integer field
Definition: types.h:53
fawkes
fawkes::interface_fieldinfo_t::enumtype
const char * enumtype
text representation of enum type
Definition: types.h:65
fawkes::interface_fieldinfo_t
Interface field info list.
Definition: types.h:62
fawkes::interface_fieldinfo_t::enum_map
const interface_enum_map_t * enum_map
Map of possible enum values.
Definition: types.h:69
fawkes::interface_enum_map_t
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
Definition: types.h:59
fawkes::interface_fieldinfo_t::name
const char * name
Name of this field.
Definition: types.h:66
fawkes::IFT_INT64
64 bit integer field
Definition: types.h:55
fawkes::IFT_DOUBLE
double field
Definition: types.h:58
fawkes::interface_fieldinfo_t::length
size_t length
Length of field (array, string)
Definition: types.h:67
fawkes::IFT_STRING
string field
Definition: types.h:59
fawkes::IFT_BYTE
byte field, alias for uint8
Definition: types.h:60
fawkes::IFT_INT16
16 bit integer field
Definition: types.h:51
fawkes::interface_fieldinfo_t::type
interface_fieldtype_t type
type of this field
Definition: types.h:64
fawkes::interface_fieldinfo_t::value
void * value
Current value of this field.
Definition: types.h:68