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

Loading...
Searching...
No Matches
LicenseMemoryStorage.h
Go to the documentation of this file.
1#ifndef LS_LICENSE_MEMORY_STORAGE_H
2#define LS_LICENSE_MEMORY_STORAGE_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning( push )
7#pragma warning( disable : 4251 )
8#endif
9
10#include <mutex>
11#include <string>
12#include "LicenseStorage.h"
13
14 namespace LicenseSpring
15{
18 class LS_API LicenseMemoryStorage : public LicenseStorage
19 {
20 public:
21 using ptr_t = std::shared_ptr<LicenseMemoryStorage>;
22
25 static ptr_t create();
26
28 LicenseMemoryStorage() = default;
29
32 void saveLicense( const std::string& licenseData );
33
36 std::string loadLicense();
37
39 void clear();
40
41 private:
42 std::string m_licenseData;
43 std::mutex m_mutex;
44 };
45} // namespace LicenseSpirng
46
47#ifdef _MSC_VER
48#pragma warning( pop )
49#endif
50
51#endif // LS_LICENSE_MEMORY_STORAGE_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::LicenseMemoryStorage
Simple class that saves license in a variable, implements LicenseStorage interface.
Definition LicenseMemoryStorage.h:19
LicenseSpring::LicenseMemoryStorage::ptr_t
std::shared_ptr< LicenseMemoryStorage > ptr_t
Definition LicenseMemoryStorage.h:21
LicenseSpring::LicenseMemoryStorage::loadLicense
std::string loadLicense()
Load license data from memory (variable).
LicenseSpring::LicenseMemoryStorage::saveLicense
void saveLicense(const std::string &licenseData)
Saves license data in a variable.
LicenseSpring::LicenseMemoryStorage::clear
void clear()
Purge license data.
LicenseSpring::LicenseMemoryStorage::LicenseMemoryStorage
LicenseMemoryStorage()=default
Constructor for LicenseMemoryStorage object.
LicenseSpring::LicenseMemoryStorage::create
static ptr_t create()
Allocates and constructs a LicenseMemoryStorage object and passes args to LicenseMemoryStorage().
LicenseSpring::LicenseStorage
LicenseStorage interface.
Definition LicenseStorage.h:17
LicenseSpring
Definition BaseManager.h:16