1 | /* ************************************************************************** * |
---|
2 | * Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011 * |
---|
3 | * ************************************************************************** */ |
---|
4 | |
---|
5 | /** |
---|
6 | * \file attribute.cpp |
---|
7 | * \brief Gestion des attributs des objets dans la hierarchie de la bibliothÚque (implémentation). |
---|
8 | * \author Hervé Ozdoba |
---|
9 | * \version 0.4 |
---|
10 | * \date 1er Juin 2011 |
---|
11 | */ |
---|
12 | |
---|
13 | // XMLIOServer headers |
---|
14 | #include "xmlioserver_spl.hpp" |
---|
15 | #include "attribute.hpp" |
---|
16 | |
---|
17 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
18 | |
---|
19 | namespace xmlioserver { |
---|
20 | namespace tree { |
---|
21 | |
---|
22 | // ------------------------------ Constructeurs ----------------------------- |
---|
23 | CAttribute::CAttribute(const std::string & _id) |
---|
24 | : CObject(_id), value() |
---|
25 | { /* Ne rien faire de plus */ } |
---|
26 | |
---|
27 | CAttribute::CAttribute(const CAttribute & _attribut_ref) |
---|
28 | : CObject(_attribut_ref.getId()) |
---|
29 | { |
---|
30 | this->value = _attribut_ref.getAnyValue(); |
---|
31 | } |
---|
32 | |
---|
33 | // ------------------------------- Destructeur ------------------------------ |
---|
34 | |
---|
35 | CAttribute::~CAttribute(void) |
---|
36 | { /* Ne rien faire de plus */ } |
---|
37 | |
---|
38 | // ------------------------------- Accesseurs ------------------------------- |
---|
39 | |
---|
40 | const boost::any & CAttribute::getAnyValue(void) const |
---|
41 | { |
---|
42 | return (this->value); |
---|
43 | } |
---|
44 | |
---|
45 | const std::string & CAttribute::getName(void) const |
---|
46 | { |
---|
47 | return (this->getId()); |
---|
48 | } |
---|
49 | |
---|
50 | // --------------------------- Tests sur l'objet ---------------------------- |
---|
51 | |
---|
52 | bool CAttribute::isEmpty(void) const |
---|
53 | { |
---|
54 | return (this->value.empty()); |
---|
55 | } |
---|
56 | |
---|
57 | // ------------------------------- Mutateurs -------------------------------- |
---|
58 | |
---|
59 | void CAttribute::setAnyValue(const boost::any & _value) |
---|
60 | { |
---|
61 | this->value = _value; |
---|
62 | } |
---|
63 | |
---|
64 | void CAttribute::clear(void) |
---|
65 | { |
---|
66 | this->value = boost::any(); |
---|
67 | } |
---|
68 | |
---|
69 | } // namespace tree |
---|
70 | } // namespace xmlioserver |
---|