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 #include <map>
30 #include <string>
31 
32 namespace fawkes {
33 
34 /** Interface field type*/
35 typedef enum {
36  IFT_BOOL, /**< boolean field */
37  IFT_INT8, /**< 8 bit integer field */
38  IFT_UINT8, /**< 8 bit unsigned integer field */
39  IFT_INT16, /**< 16 bit integer field */
40  IFT_UINT16, /**< 16 bit unsigned integer field */
41  IFT_INT32, /**< 32 bit integer field */
42  IFT_UINT32, /**< 32 bit unsigned integer field */
43  IFT_INT64, /**< 64 bit integer field */
44  IFT_UINT64, /**< 64 bit unsigned integer field */
45  IFT_FLOAT, /**< float field */
46  IFT_DOUBLE, /**< double field */
47  IFT_STRING, /**< string field */
48  IFT_BYTE, /**< byte field, alias for uint8 */
49  IFT_ENUM /**< field with interface specific enum type */
51 
52 /** Map of enum integer to string values. */
53 typedef std::map<int, std::string> interface_enum_map_t;
54 
55 /** Interface field info list */
57  interface_fieldtype_t type; /**< type of this field */
58  const char *enumtype; /**< text representation of enum type */
59  const char *name; /**< Name of this field */
60  size_t length; /**< Length of field (array, string) */
61  void *value; /**< Current value of this field */
62  const interface_enum_map_t *enum_map; /**< Map of possible enum values */
63  interface_fieldinfo_t *next; /**< next field, NULL if last */
64 };
65 
66 }
67 
68 #endif /* __INTERFACE_TYPES_H__ */
64 bit integer field
Definition: types.h:43
Interface field info list.
Definition: types.h:56
Fawkes library namespace.
const char * name
Name of this field.
Definition: types.h:59
8 bit unsigned integer field
Definition: types.h:38
16 bit unsigned integer field
Definition: types.h:40
interface_fieldinfo_t * next
next field, NULL if last
Definition: types.h:63
string field
Definition: types.h:47
byte field, alias for uint8
Definition: types.h:48
16 bit integer field
Definition: types.h:39
void * value
Current value of this field.
Definition: types.h:61
const interface_enum_map_t * enum_map
Map of possible enum values.
Definition: types.h:62
interface_fieldtype_t type
type of this field
Definition: types.h:57
64 bit unsigned integer field
Definition: types.h:44
size_t length
Length of field (array, string)
Definition: types.h:60
float field
Definition: types.h:45
32 bit integer field
Definition: types.h:41
const char * enumtype
text representation of enum type
Definition: types.h:58
boolean field
Definition: types.h:36
interface_fieldtype_t
Interface field type.
Definition: types.h:35
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
Definition: types.h:53
32 bit unsigned integer field
Definition: types.h:42
field with interface specific enum type
Definition: types.h:49
8 bit integer field
Definition: types.h:37
double field
Definition: types.h:46