LicenseSpring C++ SDK  7.31.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 
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 
55  ProductDetails getProductDetails( bool includeLatestVersion = false );
56 
61  const License::ptr_t getCurrentLicense();
62 
66  const License::ptr_t reloadLicense();
67 
70  void clearLocalStorage();
71 
78  const std::wstring& dataLocation() const;
79 
85  void setDataLocation( const std::wstring& path );
86 
90  std::wstring licenseFileName() const;
91 
96  void setLicenseFileName( const std::wstring& name );
97 
101  std::wstring licenseFilePath() const;
102 
103  protected:
105  std::shared_ptr<DataHandler> m_dataHandler;
106  LicenseService* m_pLicenseService;
108 
110  void reset();
111  };
112 }
113 
114 #ifdef _MSC_VER
115 #pragma warning( pop )
116 #endif
117 
118 #endif // LS_BASE_MANAGER_H
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
ProductDetails.h
LicenseSpring
Definition: BaseManager.h:15
LicenseSpring::BaseManager::m_config
Configuration::ptr_t m_config
Definition: BaseManager.h:104
LicenseSpring::License::ptr_t
std::shared_ptr< License > ptr_t
Definition: License.h:36
LicenseSpring::BaseManager::m_pLicenseService
LicenseService * m_pLicenseService
Definition: BaseManager.h:106
Configuration.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
LicenseStorage.h
LicenseSpring::BaseManager
Base class for license management.
Definition: BaseManager.h:23
LicenseSpring::BaseManager::m_currentLicense
License::ptr_t m_currentLicense
Definition: BaseManager.h:107
LicenseSpring::ProductDetails
Class that encapsulates information about a product.
Definition: ProductDetails.h:20
LicenseSpring::BaseManager::m_dataHandler
std::shared_ptr< DataHandler > m_dataHandler
Definition: BaseManager.h:105
License.h