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

Loading...
Searching...
No Matches
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
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:
104 Configuration::ptr_t m_config;
105 std::shared_ptr<DataHandler> m_dataHandler;
106 std::shared_ptr<LicenseService> m_pLicenseService;
107 License::ptr_t m_currentLicense;
108
110 void reset();
111 };
112}
113
114#ifdef _MSC_VER
115#pragma warning( pop )
116#endif
117
118#endif // LS_BASE_MANAGER_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
License.h
LicenseStorage.h
ProductDetails.h
LicenseSpring::BaseManager
Base class for license management.
Definition BaseManager.h:24
LicenseSpring::BaseManager::m_dataHandler
std::shared_ptr< DataHandler > m_dataHandler
Definition BaseManager.h:105
LicenseSpring::BaseManager::clearLocalStorage
void clearLocalStorage()
Remove local license, other files and folders created by LicenseSpring, usually should be called at a...
LicenseSpring::BaseManager::m_pLicenseService
std::shared_ptr< LicenseService > m_pLicenseService
Definition BaseManager.h:106
LicenseSpring::BaseManager::reset
void reset()
Reset (delete) members.
LicenseSpring::BaseManager::reconfigure
void reconfigure(Configuration::ptr_t config)
Change current configuration.
LicenseSpring::BaseManager::getCurrentLicense
const License::ptr_t getCurrentLicense()
Load license from local storage (if not yet loaded).
LicenseSpring::BaseManager::dataLocation
const std::wstring & dataLocation() const
Absolute folder path where LicenseSpring data is stored.
LicenseSpring::BaseManager::BaseManager
BaseManager(const BaseManager &)=delete
LicenseSpring::BaseManager::licenseFilePath
std::wstring licenseFilePath() const
Return concatenated dataLocation() and licenseFileName().
LicenseSpring::BaseManager::licenseFileName
std::wstring licenseFileName() const
Return license file name with extension, unless filename was explicitly set to be without extension.
LicenseSpring::BaseManager::currentConfig
Configuration::ptr_t currentConfig() const
Returns current configuration.
LicenseSpring::BaseManager::getProductDetails
ProductDetails getProductDetails(bool includeLatestVersion=false)
Get basic information from the backend on product which corresponds to the current configuration.
LicenseSpring::BaseManager::m_currentLicense
License::ptr_t m_currentLicense
Definition BaseManager.h:107
LicenseSpring::BaseManager::~BaseManager
virtual ~BaseManager()
Destroy LicenseManger with current configuration.
LicenseSpring::BaseManager::m_config
Configuration::ptr_t m_config
Definition BaseManager.h:104
LicenseSpring::BaseManager::reloadLicense
const License::ptr_t reloadLicense()
Resets current license and loads it again from local storage.
LicenseSpring::BaseManager::setLicenseFileName
void setLicenseFileName(const std::wstring &name)
Set license file name, it can be with or without extension.
LicenseSpring::BaseManager::BaseManager
BaseManager(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
Create and intialize license manager with given configuration.
LicenseSpring::BaseManager::setDataLocation
void setDataLocation(const std::wstring &path)
Set absolute or relative path to folder where LicenseSpring data should be stored.
LicenseSpring::Configuration::ptr_t
std::shared_ptr< Configuration > ptr_t
Definition Configuration.h:20
LicenseSpring::License::ptr_t
std::shared_ptr< License > ptr_t
Definition License.h:36
LicenseSpring::LicenseStorage::ptr_t
std::shared_ptr< LicenseStorage > ptr_t
Definition LicenseStorage.h:19
LicenseSpring::ProductDetails
Class that encapsulates information about a product.
Definition ProductDetails.h:21
LicenseSpring
Definition BaseManager.h:16