Bayeux  3.4.1
Core Foundation library for SuperNEMO
types.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2013-03-20
4  * Last modified: 2014-06-23
5  */
6 
7 #ifndef DATATOOLS_TYPES_H
8 #define DATATOOLS_TYPES_H
9 
10 // Standard library:
11 #include <string>
12 
13 namespace datatools {
14 
16  // Note (2014/06/23 FM): we should have used the
17  // datatools::bit_mask::bitXX values here, with:
18  // TYPE_NONE = 0x0,
19  // TYPE_BOOLEAN = datatools::bit_mask::bit00,
20  // TYPE_INTEGER = datatools::bit_mask::bit01,
21  // TYPE_REAL = datatools::bit_mask::bit02,
22  // TYPE_STRING = datatools::bit_mask::bit03,
23  // However, this is not compatible with the original values
24  // below.
25  // Any change would imply some modification of the datatools::properties
26  // serialization method and version.
27  // We do not change it for now.
28  enum basic_type {
29  TYPE_NONE = 0x0,
30  TYPE_BOOLEAN = 0x1,
31  TYPE_INTEGER = 0x2,
32  TYPE_REAL = 0x3,
33  TYPE_STRING = 0x4,
34  TYPE_ANY = 0xFFFFFFFF
35  };
36 
38  enum data_type {
39  DATA_NONE = 0x0,
40  DATA_SCALAR = 0x1,
41  DATA_ARRAY = 0x2,
43  };
44 
46  const std::string get_label_from_type(int type_);
47 
49  int get_type_from_label(const std::string & label_);
50 
51 } // end of namespace datatools
52 
53 #endif // DATATOOLS_TYPES_H
54 
55 // Local Variables: --
56 // mode: c++ --
57 // c-file-style: "gnu" --
58 // tab-width: 2 --
59 // End: --
Not defined.
Definition: types.h:39
Any type.
Definition: types.h:34
const std::string get_label_from_type(int type_)
Return the label associated to a data type.
Data is a scalar.
Definition: types.h:40
Integer data.
Definition: types.h:31
Real data (should be 0x4 to use it as a mask)
Definition: types.h:32
Character string data (should be 0x8 to use it as a mask)
Definition: types.h:33
Not defined.
Definition: types.h:29
basic_type
Basic type identifier.
Definition: types.h:28
int get_type_from_label(const std::string &label_)
Return the data type associated to a label.
data_type
Data type.
Definition: types.h:38
Data is an array (or vector)
Definition: types.h:41
Data can be both.
Definition: types.h:42
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
Boolean data.
Definition: types.h:30