delphi_cb
 All Classes Namespaces Files Functions Variables Macros
interface_datacontainer.h
Go to the documentation of this file.
1 
12 #ifndef IDATACONTAINER_H_
13 #define IDATACONTAINER_H_
14 
15 #include <iostream>
16 #include <string.h> // STL::string
17 #include <vector> // STL::vector
18 #include <map> // STL::map
19 #include <boost/any.hpp> // boost::any
20 
21 #include "environment.h"
22 #include "../io/io_datatype.h"
23 #include "interface_exceptions.h"
24 
25 using namespace std;
26 using boost::any_cast;
27 
28 typedef map<string, boost::any> DataMap;
29 
30 //-----------------------------------------------------------------------//
32 {
33  protected:
34 
39  DataMap myData;
40 
45  virtual void setMap() = 0;
46 
47  public:
48 
53  {
54 #ifdef DEBUG_OBJECT
55  cout << endl;
56  cout << "****************************************************************\n";
57  cout << "* IDataContainer is constructed *\n";
58  cout << "****************************************************************\n";
59 #endif
60  };
61 
66  virtual ~IDataContainer()
67  {
68  DataMap().swap(myData);
69 
70 #ifdef DEBUG_OBJECT
71  cout << endl;
72  cout << "****************************************************************\n";
73  cout << "* IDataContainer is destroyed *\n";
74  cout << "****************************************************************\n";
75 #endif
76  };
77 
84  bool keyExists(const string &strKey);
85 
86  //----------read-only key content in the map
93  template <class T> const T& getKey_constRef(const string& strKey);
94 
101  template <class T> const T* getKey_constPtr(const string& strKey);
102 
111  template <class T> const T** getKey_constPtr(const string& strKey,const int& iRows,const int& iColumns);
112 
122  template <class T> const T*** getKey_constPtr(const string& strKey,const int& iRows,const int& iColumns,const int& iPages);
123 
134  template <class T> const T**** getKey_constPtr(const string& strKey,const int& iRows,const int& iColumns,const int& iPages,const int& iSects);
135 
136  //----------read and write key content in the map
143  template <class T> T& getKey_Ref(const string& strKey);
144 
151  template <class T> T getKey_Val(const string& strKey);
152 
159  template <class T> T* getKey_Ptr(const string& strKey);
160 
170  template <class T> T*** getKey_Ptr(const string& strKey,const int& iRows,const int& iColumns,const int& iPages);
171 
177  virtual void showMap(const string& strMapFile) = 0;
178 
184  virtual void reset(const string& strF95File) = 0;
185 };
186 
187 #endif // IDATACONTAINER_H_
IDataContainer()
Definition: interface_datacontainer.h:52
Definition: interface_datacontainer.h:31
virtual ~IDataContainer()
Definition: interface_datacontainer.h:66
warnings/exceptions occurring in interface classes
pre-processor marco's used for compiling the code
DataMap myData
Definition: interface_datacontainer.h:39