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