ANNA Suite  2020b
Multipurpose development suite for Telco applications
Configuration.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_core_oam_Configuration_hpp
10 #define anna_core_oam_Configuration_hpp
11 
12 
13 #include <anna/core/Singleton.hpp>
15 
16 // STL
17 #include <string>
18 #include <vector>
19 
20 namespace anna {
21 namespace xml {
22 class Node;
23 }
24 }
25 
26 
27 namespace anna {
28 
29 namespace oam {
30 
31 
35 class Configuration : public anna::Singleton <Configuration> {
36 
37  // Post-configuration for the final alarm text used for context data over each module (functionality, logic data, etc.):
38  typedef std::vector<std::string> string_vector_t;
39  string_vector_t a_alarm_text_preffix_components;
40  string_vector_t a_alarm_text_suffix_components;
41  bool a_alarms_preffix_enabled; // Show general alarm preffix
42  bool a_alarms_suffix_enabled; // Show general alarm suffix
43 
44 
45  // Delimiters (zone separator for preffix/text/suffix, and left/right/separator for preffix/suffix):
46  char a_alarm_text_delimiter_zS;
47  std::string a_alarm_text_delimiter_psL;
48  std::string a_alarm_text_delimiter_psS;
49  std::string a_alarm_text_delimiter_psR;
50 
51  const string_vector_t * getAlarmPreffixComponents() const { return (a_alarms_preffix_enabled ? &a_alarm_text_preffix_components : NULL); }
52  const string_vector_t * getAlarmSuffixComponents() const { return (a_alarms_suffix_enabled ? &a_alarm_text_suffix_components : NULL); }
53 
54  void getAlarmTextDelimiters(char & zS, std::string & psL, std::string & psS, std::string & psR) const ;
55 
56 
57  Configuration(); // private constructor
58 
60  friend class Module;
61 
62 public:
63 
85  void setAlarmTextDelimiters(const char zS, const std::string & psL, const std::string & psS, const std::string & psR) ;
86 
87 
97  void setAlarmPreffixComponents(const std::vector<std::string> & components) { a_alarm_text_preffix_components = components; }
98 
99 
109  void setAlarmSuffixComponents(const std::vector<std::string> & components) { a_alarm_text_suffix_components = components; }
110 
111 
115  void enableAlarmsPreffix() ;
116 
117 
121  void enableAlarmsSuffix() ;
122 
123 
127  void disableAlarmsPreffix() ;
128 
129 
133  void disableAlarmsSuffix() ;
134 
140  anna::xml::Node* asXML(anna::xml::Node* parent) const ;
141 };
142 
143 }
144 }
145 
146 #endif
147 
Definition: Configuration.hpp:35
Definition: Module.hpp:135
Definition: Node.hpp:56
Definition: Singleton.hpp:76
void setAlarmSuffixComponents(const std::vector< std::string > &components)
Definition: Configuration.hpp:109
xml::Node Node
Definition: Node.hpp:21
Definition: app.hpp:12
void setAlarmPreffixComponents(const std::vector< std::string > &components)
Definition: Configuration.hpp:97