ANNA Suite  2020b
Multipurpose development suite for Telco applications
TextVariable.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_TextVariable_hpp
10 #define anna_core_util_TextVariable_hpp
11 
14 
15 namespace anna {
16 
17 class DataBlock;
18 
19 class TextComposer;
20 
24 class TextVariable : public Variable {
25 public:
30  TextVariable& operator= (const int value) noexcept(false) { setValue(value); return *this; }
31 
36  TextVariable& operator= (const char* value) noexcept(false) { setValue(value); return *this; }
37 
42  TextVariable& operator= (const anna::String& value) noexcept(false) { setValue(value.c_str()); return *this; }
43 
48  TextVariable& operator= (const S64 value) noexcept(false) { setValue(value); return *this; }
49 
54  TextVariable& operator= (const float value) noexcept(false) { setValue(value); return *this; }
55 
60  TextVariable& operator= (const double value) noexcept(false) { setValue(value); return *this; }
61 
62 protected:
69  TextVariable(const char* name, const Type::_v type, const anna::String& expression);
70 
71 
72 private:
73  const anna::String a_expression;
74 
75  const char* compose(DataBlock& buffer) const noexcept(false);
76 
77  friend class TextComposer;
78 };
79 
80 }
81 
82 #endif
83 
TextVariable(const char *name, const Type::_v type, const anna::String &expression)
Definition: TextComposer.hpp:59
void * buffer() const
Definition: TextVariable.hpp:24
int64_t S64
Definition: defines.hpp:84
Definition: String.hpp:25
TextVariable & operator=(const int value) noexcept(false)
Definition: TextVariable.hpp:30
Definition: app.hpp:12
_v
Definition: Variable.hpp:31
void setValue(const char *value) noexcept(false)
Definition: Variable.hpp:25
Definition: DataBlock.hpp:24