ANNA Suite  2020b
Multipurpose development suite for Telco applications
TextManager.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_util_TextManager_hpp
10 #define anna_core_util_TextManager_hpp
11 
12 #include <vector>
13 
14 #include <anna/core/functions.hpp>
15 #include <anna/core/mt/Mutex.hpp>
16 
17 namespace anna {
18 
19 class TextComposer;
20 
24 class TextManager : public Mutex {
25 public:
29  TextManager(const char* name);
30 
34  virtual ~TextManager() { clear(); }
35 
41  TextComposer& operator [](const int composer) noexcept(false) { return find(composer); }
42 
48  const TextComposer& operator [](const int composer) const noexcept(false) { return find(composer); }
49 
56  void create(const int composer, const char* expression) noexcept(false);
57 
64  TextComposer& find(const int composer) noexcept(false);
65 
72  const TextComposer& find(const int composer) const noexcept(false);
73 
77  void clear() ;
78 
87  virtual TextComposer* createTextComposer(const int composer, const char* expression) ;
88 
89 private:
90  typedef std::vector <TextComposer*> TextComposerVector;
91 
92  const char* a_name;
93  TextComposerVector a_composers;
94 
95  TextManager(const TextManager&);
96 
97  TextComposer* xfind(const int composer) ;
98 };
99 
100 }
101 
102 #endif
103 
Definition: TextComposer.hpp:59
TextComposer & find(const int composer) noexcept(false)
virtual ~TextManager()
Definition: TextManager.hpp:34
Definition: TextManager.hpp:24
void create(const int composer, const char *expression) noexcept(false)
TextManager(const char *name)
Definition: app.hpp:12
TextComposer & operator[](const int composer) noexcept(false)
Definition: TextManager.hpp:41
Definition: Mutex.hpp:41
virtual TextComposer * createTextComposer(const int composer, const char *expression)