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
16{
17 class LicenseService;
18 class DataHandler;
19
24 {
25 public:
31 BaseManager( const BaseManager& ) = delete;
32 BaseManager& operator =( const BaseManager& ) = delete;
34 virtual ~BaseManager();
35
39
44
55
61
66
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:
104 std::shared_ptr<DataHandler> m_dataHandler;
105 LicenseService* m_pLicenseService;
107
109 void reset();
110 };
111}
112
113#ifdef _MSC_VER
114#pragma warning( pop )
115#endif
116
117#endif // LS_BASE_MANAGER_H
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22
Base class for license management.
Definition: BaseManager.h:24
std::shared_ptr< DataHandler > m_dataHandler
Definition: BaseManager.h:104
void clearLocalStorage()
Remove local license, other files and folders created by LicenseSpring, usually should be called at a...
void reset()
Reset (delete) members.
void reconfigure(Configuration::ptr_t config)
Change current configuration.
const License::ptr_t getCurrentLicense()
Load license from local storage (if not yet loaded).
const std::wstring & dataLocation() const
Absolute folder path where LicenseSpring data is stored.
LicenseService * m_pLicenseService
Definition: BaseManager.h:105
BaseManager(const BaseManager &)=delete
ProductDetails getProductDetails()
Get basic information from the backend on product which corresponds to the current configuration.
std::wstring licenseFilePath() const
Return concatenated dataLocation() and licenseFileName().
std::wstring licenseFileName() const
Return license file name with extension, unless filename was explicitly set to be without extension.
Configuration::ptr_t currentConfig() const
Returns current configuration.
License::ptr_t m_currentLicense
Definition: BaseManager.h:106
virtual ~BaseManager()
Destroy LicenseManger with current configuration.
Configuration::ptr_t m_config
Definition: BaseManager.h:103
const License::ptr_t reloadLicense()
Resets current license and loads it again from local storage.
void setLicenseFileName(const std::wstring &name)
Set license file name, it can be with or without extension.
BaseManager(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
Create and intialize license manager with given configuration.
void setDataLocation(const std::wstring &path)
Set absolute or relative path to folder where LicenseSpring data should be stored.
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:20
std::shared_ptr< License > ptr_t
Definition: License.h:36
std::shared_ptr< LicenseStorage > ptr_t
Class that encapsulates information about a product.