Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
ConnectionType.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_DATA_CONNECTIONTYPE_HPP_INCLUDED
5 #define FIRE_DATA_CONNECTIONTYPE_HPP_INCLUDED
6 
7 #include <string>
8 #include <sstream>
9 
10 namespace fire {
11 namespace source {
12 namespace ConnectionType {
13 
17 enum ConnectionType {
21  UNKNOWN = -1,
25  RASTER = 1,
29  SPATIAL_DB,
33  VECTOR
34 };
35 
41 inline std::string toString(ConnectionType const & t) {
42  std::stringstream ss;
43  ss << "fire::source::ConnectionType";
44  switch (t) {
45  case UNKNOWN:
46  ss << "::UNKNOWN";
47  break;
48  case RASTER:
49  ss << "::RASTER";
50  break;
51  case VECTOR:
52  ss << "::VECTOR";
53  break;
54  case SPATIAL_DB:
55  ss << "::SPATIAL_DB";
56  break;
57  }
58 
59  return ss.str();
60 }
61 
67 inline ConnectionType fromString(std::string const & val) {
68  ConnectionType list[] = {
69  UNKNOWN,
70  RASTER,
71  VECTOR,
72  SPATIAL_DB
73  };
74 
75  int len = sizeof(list)/sizeof(ConnectionType);
76  for (int i = 0; i < len; i++) {
77  ConnectionType item = list[i];
78  if (toString(item) == val)
79  return item;
80  }
81 
82  return UNKNOWN;
83 }
84 
85 } // namespace ConnectionType
86 } // namespace source
87 } // namespace fire
88 
89 #endif
BooleanOperator fromString(const std::string &string)
Restituisce il valore di un operatore booleano data una stringa che rappresenta il valore dell'operat...
Definition: BooleanOperator.hpp:88
std::string toString(const BooleanOperator &booleanOperator)
Restituisce la stringa che rappresenta il valore di un operatore booleano dato il valore di un operat...
Definition: BooleanOperator.hpp:40