LicenseSpring C++ SDK
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 "UserLicensesData.h"
13 #include "License.h"
14 #include "LicenseStorage.h"
15 
16 namespace LicenseSpring
17 {
18  class LicenseService;
19  class DataHandler;
20 
25  {
26  public:
31  BaseManager( Configuration::ptr_t config, LicenseStorage::ptr_t storage = nullptr );
32  BaseManager( const BaseManager& ) = delete;
33  BaseManager& operator =( const BaseManager& ) = delete;
35  virtual ~BaseManager();
36 
39  Configuration::ptr_t currentConfig() const;
40 
44  void reconfigure( Configuration::ptr_t config );
45 
57  ProductDetails getProductDetails( bool includeLatestVersion = false );
58 
63  bool isLicenseFileCorrupted();
64 
69  const License::ptr_t getCurrentLicense();
70 
74  const License::ptr_t reloadLicense();
75 
78  void clearLocalStorage();
79 
86  const std::wstring& dataLocation() const;
87 
93  void setDataLocation( const std::wstring& path );
94 
98  std::wstring licenseFileName() const;
99 
104  void setLicenseFileName( const std::wstring& name );
105 
109  std::wstring licenseFilePath() const;
110 
111  protected:
113  std::shared_ptr<DataHandler> m_dataHandler;
114  std::shared_ptr<LicenseService> m_pLicenseService;
116 
118  void reset();
119  };
120 }
121 
122 #ifdef _MSC_VER
123 #pragma warning( pop )
124 #endif
125 
126 #endif // LS_BASE_MANAGER_H
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:20
std::shared_ptr< LicenseStorage > ptr_t
Base class for license management.
Definition: BaseManager.h:24
std::shared_ptr< License > ptr_t
Definition: License.h:36
std::shared_ptr< LicenseService > m_pLicenseService
Definition: BaseManager.h:114
Configuration::ptr_t m_config
Definition: BaseManager.h:112
License::ptr_t m_currentLicense
Definition: BaseManager.h:115
std::shared_ptr< DataHandler > m_dataHandler
Definition: BaseManager.h:113
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22
Class that encapsulates information about a product.