ANNA Suite  2020b
Multipurpose development suite for Telco applications
Attribute.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_xml_Attribute_hpp
10 #define anna_xml_Attribute_hpp
11 
12 #include <anna/core/Allocator.hpp>
13 #include <anna/xml/Data.hpp>
14 
15 namespace anna {
16 
17 namespace xml {
18 
19 class Namespace;
20 
35 class Attribute : public Data {
36 public:
41  const char* getName() const { return a_name.c_str(); }
42 
47  const Namespace* getNamespace() const { return a_namespace; }
48 
53  const std::string& getNameAsString() const { return a_name; }
54 
59  std::string asString() const ;
60 
61 private:
62  std::string a_name;
63  const Namespace* a_namespace;
64 
65  /* Para evitar que se pueda crear desde el exterior */
66  Attribute() : Data(), a_namespace(NULL) {;}
67 
68  virtual ~Attribute() {;}
69 
70  void setName(const char* name) { a_name = name; }
71  void setNamespace(const Namespace* _namespace) { a_namespace = _namespace; }
72 
73  friend class Node;
74  friend class Allocator<Attribute>;
75 };
76 
77 }
78 }
79 
80 #endif
const std::string & getNameAsString() const
Definition: Attribute.hpp:53
Data()
Definition: Data.hpp:86
std::string asString() const
Definition: Node.hpp:56
Definition: Namespace.hpp:30
Definition: Attribute.hpp:35
Definition: Allocator.hpp:19
Definition: Data.hpp:38
Definition: app.hpp:12
const Namespace * getNamespace() const
Definition: Attribute.hpp:47
const char * getName() const
Definition: Attribute.hpp:41