IAddInfoContainer.hpp
1 #ifndef DM_IADDINFO_CONTAINER_HPP_INCLUDED
2 #define DM_IADDINFO_CONTAINER_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/IAddInfo.hpp"
10 
11 DM_NAMESPACE_BEGIN
12 
13 /// \brief Interface of an add info container object (used by geometry objects)
14 /**
15  Managing attributes, layout and views is a core feature of the DM library. Please refer to the
16  \ref dm_attributes section for implementation concepts and to the <a href="examples.html">examples</a>
17  section (attribute handling) for further details.
18 */
19 class DM_API IAddInfoContainer
20 {
21 public:
22  virtual ~IAddInfoContainer() {}
23 
24  virtual bool hasInfo() const = 0;
25  virtual const IAddInfo &info() const = 0;
26  virtual IAddInfo &info() = 0;
27 
28  virtual AddInfoHandle getAddInfo() const = 0;
29  virtual void setAddInfo(const AddInfoHandle &) = 0;
30 
31  /// \brief applies a certain layout view onto the current addinfo object
32  /**
33  for further details see IAddInfo::setView
34  @param[in] layout view layout that should be set
35  @param[in] readOnly flag if the layout of storage object should be changed, in case the view layout is not a true subset of the storage layout
36  */
37  virtual void setAddInfoView(const AddInfoLayoutHandle &layout, bool readOnly) = 0;
38  /// \brief removes any view layout and sets the true storage layout as (internal) layout
39  virtual void restoreAddInfoFullLayout() = 0;
40 
41  /// \brief internal creates a new addinfo object with the provide view layout that refers to the same storage object
42  /**
43  for further details see IAddInfo::cloneView
44  @param[in] layout view layout that should be set
45  @param[in] readOnly flag if the layout of storage object should be changed, in case the view layout is not a true subset of the storage layout
46  */
47  virtual void cloneAddInfoView(const AddInfoLayoutHandle &layout, bool readOnly) const = 0;
48  /// \brief internal creates a new addinfo object with the provide view layout and secures that the storage object contains the dataLayout
49  /**
50  for further details see IAddInfo::cloneView
51  @param[in] viewLayout view layout that should be set
52  @param[in] dataLayout defines columns that have to exist in the storage object
53  */
54  virtual void cloneAddInfoView(const AddInfoLayoutHandle &viewLayout, const AddInfoLayoutHandle &dataLayout) const = 0;
55  /// \brief internal creates a new addinfo object using the true storage layout that referring to the same storage object
56  virtual void cloneAddInfoFullLayout() const = 0;
57 
58  ///optimised variante to access a view column
59  /// \return true is value is not null otherwise false
60  virtual bool getAsDoubleByView(const AddInfoLayoutHandle &, unsigned index, double &value) const = 0;
61  virtual bool getAsLLongByView(const AddInfoLayoutHandle &, unsigned index, long long &value) const = 0;
62 
63  /// removes the specified attributs from current object
64  virtual void eraseLayout(const AddInfoLayoutHandle &) = 0;
65 
66 };
67 
68 DM_NAMESPACE_END
69 
70 
71 #endif //DM_IADDINFO_CONTAINER_HPP_INCLUDED