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
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 ProductDetails getProductDetails( bool includeLatestVersion = false );
56
62
67
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
#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:105
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:106
BaseManager(const BaseManager &)=delete
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.
ProductDetails getProductDetails(bool includeLatestVersion=false)
Get basic information from the backend on product which corresponds to the current configuration.
License::ptr_t m_currentLicense
Definition: BaseManager.h:107
virtual ~BaseManager()
Destroy LicenseManger with current configuration.
Configuration::ptr_t m_config
Definition: BaseManager.h:104
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.