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_ldap_Attribute_hpp
10 #define anna_ldap_Attribute_hpp
11 
12 #include <string>
13 
15 
16 namespace anna {
17 
18 namespace ldap {
19 
20 class Session;
21 class Response;
22 
30 class Attribute {
31 public:
34 
39  const std::string& getName() const { return a_name; }
40 
45  const_value_iterator value_begin() const { return a_values.begin(); }
46 
51  const_value_iterator value_end() const { return a_values.end(); }
52 
59  static const std::string& value(const_value_iterator ii) { return *value_container::data(ii); }
60 
61 private:
62  std::string a_name;
63  value_container a_values;
64 
65  Attribute() {;}
66 
67  void setName(const std::string& name) { a_name = name; }
68 
69  void add(const std::string& value) noexcept(false) {
70  std::string* newValue = a_values.create();
71  *newValue = value;
72  }
73  void clear() { a_name.clear(); a_values.clear(); }
74 
75  friend class Session;
76  friend class Response;
77  friend class Allocator<Attribute>;
78 };
79 
80 }
81 }
82 
83 #endif
84 
static std::string * data(iterator ii)
Definition: Recycler.hpp:233
Definition: Response.hpp:35
Definition: Session.hpp:38
container::const_iterator const_iterator
Definition: Recycler.hpp:34
T * create() noexcept(false)
Definition: Recycler.hpp:88
static const std::string & value(const_value_iterator ii)
Definition: Attribute.hpp:59
const_value_iterator value_begin() const
Definition: Attribute.hpp:45
iterator end()
Definition: Recycler.hpp:221
const_value_iterator value_end() const
Definition: Attribute.hpp:51
Definition: Allocator.hpp:19
Definition: app.hpp:12
Recycler< std::string > value_container
Definition: Attribute.hpp:32
const std::string & getName() const
Definition: Attribute.hpp:39
value_container::const_iterator const_value_iterator
Definition: Attribute.hpp:33
void clear()
Definition: Recycler.hpp:196
iterator begin()
Definition: Recycler.hpp:209
Definition: Attribute.hpp:30