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

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
LicenseSpring
Definition: BaseManager.h:15
LicenseSpring::LicenseMemoryStorage::ptr_t
std::shared_ptr< LicenseMemoryStorage > ptr_t
Definition: LicenseMemoryStorage.h:21
LicenseStorage.h
LicenseSpring::LicenseStorage
LicenseStorage interface.
Definition: LicenseStorage.h:16
LicenseSpring::LicenseMemoryStorage
Simple class that saves license in a variable, implements LicenseStorage interface.
Definition: LicenseMemoryStorage.h:18
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