Datamanager.hpp
1 #ifndef DM_DATAMANAGER_HPP_INCLUDED
2 #define DM_DATAMANAGER_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/AutoLink.hpp" //enable autolink
10 #include "DM/IDatamanager.hpp"
11 #include "DM/IAddInfoLayoutFactory.hpp"
12 #include "DM/IPolylineFactory.hpp"
13 #include "DM/IPolygonFactory.hpp"
14 #include "DM/InsertIterator.hpp"
15 #include "DM/ISpatialIndexFactory.hpp"
16 #include "DM/IParameterSet.hpp"
17 
18 DM_NAMESPACE_BEGIN
19 
20 //forward declaration
21 class CostumerModuleInterface;
22 
23 
24 /// Get the DM version
25 DM_API const char* getVersion();
26 
27 /// Compares the provided version against the internal DM version
28 /// \return 1 if internal version is greater than the provided version string
29 /// \return 0 if internal version is equal than the provided version string
30 /// \return -1 if internal version is less than the provided version string
31 DM_API int compareVersion(const char *versionStr);
32 
33 /// \brief Checks if the provided DM version string is compatible to the internal DM version.
34 /**
35  * The version is compatible if the internal DM version is equal or newer and no major interface changes
36  * have been made (lookup in internal compatibility map):
37  * no function, interface, etc. removed and no semantic or behavior changes introduced.
38  */
39 DM_API bool compatibleVersion(const char *versionStr);
40 
41 /// If the DLL version of DM library and the NG_lib are used in one project, it is HIGHLY RECOMMENDED to
42 /// synchronize the two (DLL and local NG_lib) NG_AddInfoLayoutManager objects. Execute the following call
43 /// before using any NG_lib object:
44 /// DM::registerLayoutManager( &NG_AddInfoLayoutManager::h_data() );
45 /// (This function is not instantiated in the static library to secure that the dynamic library function is called)
46 DM_API void registerLayoutManager(void *dataHandle);
47 /// If the DLL version of DM library and the NG_lib are used in one project, it is necessary that synchronize
48 /// the two static costumer maps. otherwise the costumer/demo information is not handled correctly
49 /// DM::registerCostumerData( &DM::h_CostumerMap() );
50 ///
51 DM_API void registerCostumerData(void *dataHandle);
52 
53 
54 
55 /// Demo API functions
56 /**
57  * the datamanager is NOT in demo mode on startup. The demo mode restricts the number of points to
58  * 1 mio points. Points above the limit are ignored during import and manager files with more than 1
59  * mio points cannot be opened.
60  */
61 //DM_API void setDemoMode(void *instance, bool flag = true);
62 
63 /// returns the demo flag
64 DM_API bool demoMode(void *instance);
65 
66 /// Get the maximum number of points that is admissible in demo mode.
67 DM_API unsigned long long demoModeLimit();
68 
69 /// Set costumer affiliation which is stored in the manager file
70 //DM_API void setCostumerAffiliation(void *instance, const char *name, const char *address, bool demoMode = false);
71 
72 /// Register opals module for providing the corresponding costumer information
73 DM_API void registerModule(void *instance, CostumerModuleInterface const *data);
74 
75 
76 /// Licence error code
77 namespace Licence {
78  enum Type {
79  ok = 0, ///< no error. licence ok
80  not_available, ///< licence not available
81  not_active_yet, ///< licence not activate yet
82  expired, ///< licence expired
83  embedded_only, ///< licence valid only for embedded application
84  file_not_found, ///< licence file doesn't exist
85  file_inaccessible,///< licence file not accessible
86  file_corrupt, ///< licence file corrupt
87  crypto_error, ///< licence crypto error
88  invalid_version, ///< licence file version error
89  invalid_update, ///< licence not valid for this update
90  unknown_error ///< unknown error occurred
91  };
92 }
93 
94 /// Set full path of licence file in case it is not located in the corresponding default search path (see details below)
95 /** default search path order
96  <Datamanager-DLL-Path>/opals.key
97  <Datamanager-DLL-Path>/../cfg/opals.key
98  <opals_base-DLL-Path>/opals.key
99  <opals_base-DLL-Path>/../cfg/opals.key
100 
101  \return true if licence is valid otherwise false (in this case use getLicenceErrorCode/getLicenceErrorText for details)
102 */
103 DM_API bool setLicenceFile(const char *keyfile);
104 DM_API bool setLicenceFile(const char *keyfile, const char *embeddedSoftware);
105 
106 ///check the result of the licence test
107 DM_API Licence::Type getLicenceErrorCode();
108 DM_API const char* getLicenceErrorText();
109 
110 DM_NAMESPACE_END
111 
112 #endif //DM_DATAMANAGER_HPP_INCLUDED