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