| LicenseSpring C++ SDK 7.27.0 Easily add Software Licensing to your application

BaseManager.h
Go to the documentation of this file.
1 #ifndef LS_BASE_MANAGER_H
2 #define LS_BASE_MANAGER_H
3
4 #ifdef _MSC_VER
5 #pragma once
6 #pragma warning( push )
7 #pragma warning( disable : 4251 )
8 #endif
9
10 #include "Configuration.h"
11 #include "ProductDetails.h"
12 #include "License.h"
13 #include "LicenseStorage.h"
14
15 namespace LicenseSpring
16 {
17 class LicenseService;
18 class DataHandler;
19
23 class LS_API BaseManager
24 {
25 public:
30 BaseManager( Configuration::ptr_t config, LicenseStorage::ptr_t storage = nullptr );
31 BaseManager( const BaseManager& ) = delete;
32 BaseManager& operator =( const BaseManager& ) = delete;
34 virtual ~BaseManager();
35
38 Configuration::ptr_t currentConfig() const;
39
43 void reconfigure( Configuration::ptr_t config );
44
54 ProductDetails getProductDetails();
55
60 const License::ptr_t getCurrentLicense();
61
65 const License::ptr_t reloadLicense();
66
69 void clearLocalStorage();
70
77 const std::wstring& dataLocation() const;
78
84 void setDataLocation( const std::wstring& path );
85
89 std::wstring licenseFileName() const;
90
95 void setLicenseFileName( const std::wstring& name );
96
100 std::wstring licenseFilePath() const;
101
102 protected:
103 Configuration::ptr_t m_config;
104 std::shared_ptr<DataHandler> m_dataHandler;
105 LicenseService* m_pLicenseService;
106 License::ptr_t m_currentLicense;
107
109 void reset();
110 };
111 }
112
113 #ifdef _MSC_VER
114 #pragma warning( pop )
115 #endif
116
117 #endif // LS_BASE_MANAGER_H
LicenseSpring
Definition: BaseManager.h:15
LicenseSpring::Configuration::ptr_t
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:20
LicenseSpring::LicenseStorage::ptr_t
std::shared_ptr< LicenseStorage > ptr_t
Definition: LicenseStorage.h:19
LicenseSpring::BaseManager
Base class for license management.
Definition: BaseManager.h:23
LicenseStorage.h
LicenseSpring::License::ptr_t
std::shared_ptr< License > ptr_t
Definition: License.h:36
LicenseSpring::BaseManager::m_pLicenseService
LicenseService * m_pLicenseService
Definition: BaseManager.h:105
LicenseSpring::BaseManager::m_config
Configuration::ptr_t m_config
Definition: BaseManager.h:103
ProductDetails.h
LicenseSpring::BaseManager::m_currentLicense
License::ptr_t m_currentLicense
Definition: BaseManager.h:106
LicenseSpring::BaseManager::m_dataHandler
std::shared_ptr< DataHandler > m_dataHandler
Definition: BaseManager.h:104
License.h
LS_API
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22
Configuration.h
LicenseSpring::ProductDetails
Class that encapsulates information about a product.
Definition: ProductDetails.h:19