All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DatastoreItem.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 /**
33  \file DatastoreItem.hpp
34  \brief Header of ...
35 
36  \author Aline LIBRES <libres@supagro.inra.fr>
37  */
38 
39 #ifndef __DATASTOREITEM_HPP__
40 #define __DATASTOREITEM_HPP__
41 
42 #include <openfluid/dllexport.hpp>
43 
44 #include <string>
45 
47 
48 namespace openfluid {
49 namespace core {
50 
51 /**
52  * @brief Item of a Datastore, giving information about an additional resource.
53  */
55 {
56  private:
57 
58  std::string m_ID;
59 
60  std::string m_PrefixPath;
61 
62  std::string m_RelativePath;
63 
64  std::string m_UnitClass;
65 
66  UnstructuredValue* m_Value;
67 
68  public:
69 
70  /**
71  * @brief Creates a new resource item.
72  *
73  * Tries to create a new resource item and its associated UnstructuredValue,
74  * depending on the given type.
75  *
76  * @param ID The ID of the item.
77  * @param PrefixPath The prefix path of the item, usually the IN directory of the project.
78  * @param RelativePath The relative path of the item from the PrefixPath
79  * @param Type The type of the item.
80  * @param UnitClass (optional) The associated unit class of the item.
81  * @throw openfluid::base::OFException if the given type is unknown.
82  */
83  DatastoreItem(std::string ID, std::string PrefixPath, std::string RelativePath,
84  UnstructuredValue::UnstructuredType Type, std::string UnitClass = "");
85 
86  /**
87  * @brief Destroys the resource and its associated value.
88  */
89  ~DatastoreItem();
90 
91  std::string getID() const;
92 
93  /**
94  * @brief Returns the prefix path of the resource
95  */
96  std::string getPrefixPath() const;
97 
98  /**
99  * @brief Returns the path of the resource, relative to prefix path.
100  */
101  std::string getRelativePath() const;
102 
103  std::string getUnitClass() const;
104 
105  /**
106  * @brief Gets the associated value of the resource.
107  */
108  UnstructuredValue* getValue();
109 
110  /**
111  * @brief Gets the associated value of the resource.
112  */
113  const UnstructuredValue* getValue() const;
114 };
115 
116 }
117 } // namespaces
118 
119 #endif /* __DATASTOREITEM_HPP__ */
Header of ...
UnstructuredType
Definition: UnstructuredValue.hpp:53
Item of a Datastore, giving information about an additional resource.
Definition: DatastoreItem.hpp:54
Definition: UnstructuredValue.hpp:49
#define DLLEXPORT
Definition: dllexport.hpp:51