AdvancedDatastoreDescriptor.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 AdvancedDatastoreDescriptor.hpp
34 
35  @author Aline LIBRES <aline.libres@gmail.com>
36  */
37 
38 
39 #ifndef __OPENFLUID_FLUIDX_ADVANCEDDATASTOREDESCRIPTOR_HPP__
40 #define __OPENFLUID_FLUIDX_ADVANCEDDATASTOREDESCRIPTOR_HPP__
41 
42 
43 #include <list>
44 #include <string>
45 #include <openfluid/dllexport.hpp>
46 
48 #include <openfluid/core/TypeDefs.hpp>
49 
50 
51 namespace openfluid { namespace fluidx {
52 
53 
56 
57 
59 {
60  private:
61 
63 
64  public:
65 
67 
69 
70  const std::list<openfluid::fluidx::DatastoreItemDescriptor*>& items() const;
71 
72  std::list<openfluid::fluidx::DatastoreItemDescriptor*>
73  getItems(const openfluid::core::UnitsClass_t& UnitClass) const;
74 
75  std::list<openfluid::fluidx::DatastoreItemDescriptor*>
76  getItems(const openfluid::core::UnitsClass_t& UnitClass,
78 
79  /**
80  Move the Item located at the given From position to the To position (positions starts at index 0)
81  @param From
82  @param To
83  @throw openfluid::base::FrameworkException a position is out of range
84  */
85  void moveItem(unsigned int From, unsigned int To);
86 
87  void appendItem(openfluid::fluidx::DatastoreItemDescriptor* Item);
88 
89  /**
90  Insert an Item before the given position (positions starts at index 0)
91  @param[in] Item the DatastoreItemDescriptor to insert
92  @param[in] Position the position, should be between zero and list size - 1.
93  To insert an Item at the end of the list, use appendItem instead.
94  @throw openfluid::base::FrameworkException if Position is out of range
95  */
96  void insertItem(openfluid::fluidx::DatastoreItemDescriptor* Item,
97  unsigned int Position);
98 
99  /**
100  Remove from the list the Item located at the given Position (positions starts at index 0).
101  This doesn't delete the DatastoreItemDescriptor pointer.
102  @param[in] Position the position
103  @throw openfluid::base::FrameworkException if Position is out of range
104  */
105  void removeItem(unsigned int Position);
106 
107  std::list<std::string> getItemsIDs() const;
108 
109  bool isItemAlreadyExist(std::string ItemID) const;
110 
111  /**
112  @brief Gets the item of the datastore matching the given ID.
113 
114  @param ItemID ID of the expected item.
115  @return The item with the given ID, or 0 if not found.
116  */
117  openfluid::fluidx::DatastoreItemDescriptor* item(const std::string& ItemID);
118 
119 };
120 
121 
122 } } // namespaces
123 
124 
125 #endif /* __OPENFLUID_FLUIDX_ADVANCEDDATASTOREDESCRIPTOR_HPP__ */
UnstructuredType
Definition: UnstructuredValue.hpp:53
Definition: DatastoreDescriptor.hpp:52
#define OPENFLUID_API
Definition: dllexport.hpp:87
Definition: AdvancedDatastoreDescriptor.hpp:58
Definition: ApplicationException.hpp:47
std::string UnitsClass_t
Definition: TypeDefs.hpp:71
Definition: DatastoreItemDescriptor.hpp:55