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
EntityEventType.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_GEAR_EVENT_ENTITYEVENTTYPE_HPP_INCLUDED
5 #define FIRE_GEAR_EVENT_ENTITYEVENTTYPE_HPP_INCLUDED
6 
11 namespace fire {
16 namespace gear {
21 namespace event {
26 namespace EntityEventType {
32  Unknown,
33  BeforeUpdate,
34  AfterUpdate,
35  BeforeDestroy,
36  AfterDestroy
37 };
48 inline std::string toString(const EntityEventType& entityEventType) {
49  std::string value = "";
50  try {
51  switch (entityEventType) {
52  case Unknown: {
53  value = "Unknown";
54  break;
55  }
56  case BeforeUpdate: {
57  value = "BeforeUpdate";
58  break;
59  }
60  case AfterUpdate: {
61  value = "AfterUpdate";
62  break;
63  }
64  case BeforeDestroy: {
65  value = "BeforeDestroy";
66  break;
67  }
68  case AfterDestroy: {
69  value = "AfterDestroy";
70  break;
71  }
72  }
73  } catch (const std::exception& exception) {
74  throw;
75  }
76  return value;
77 }
88 inline EntityEventType fromString(const std::string& string) {
89  EntityEventType value = Unknown;
90  try {
91  if (string == "Unknown") {
92  value = Unknown;
93  } else if (string == "BeforeUpdate") {
94  value = BeforeUpdate;
95  } else if (string == "AfterUpdate") {
96  value = AfterUpdate;
97  } else if (string == "BeforeDestroy") {
98  value = BeforeDestroy;
99  } else if (string == "AfterDestroy") {
100  value = AfterDestroy;
101  } else {
102  value = Unknown;
103  }
104  } catch (const std::exception& exception) {
105  throw;
106  }
107  return value;
108 }
109 } // EntityEventType event
110 } // namespace event
111 } // namespace gear
112 } // namespace fire
113 
114 #endif
EntityEventType
Enumerativo per la gestione di un tipo di evento di entità
Definition: EntityEventType.hpp:31
EntityEventType fromString(const std::string &string)
Restituisce il valore di un tipo di evento di entità data una stringa che rappresenta il valore del t...
Definition: EntityEventType.hpp:88
std::string toString(const EntityEventType &entityEventType)
Restituisce la stringa che rappresenta il valore di un tipo di evento di entità dato il valore di un ...
Definition: EntityEventType.hpp:48