LicenseSpring C++ SDK
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 {
20 {
21 public:
22  using ptr_t = std::shared_ptr<LicenseMemoryStorage>;
23 
28  static ptr_t create();
29 
31  LicenseMemoryStorage() = default;
32 
35  void saveLicense(const std::string &licenseData);
36 
39  std::string loadLicense();
40 
42  void clear();
43 
44 private:
45  std::string m_licenseData;
46  std::mutex m_mutex;
47 };
48 } // namespace LicenseSpring
49 
50 #ifdef _MSC_VER
51 #pragma warning(pop)
52 #endif
53 
54 #endif // LS_LICENSE_MEMORY_STORAGE_H
LicenseSpring
Definition: BaseManager.h:16
LicenseSpring::LicenseMemoryStorage::ptr_t
std::shared_ptr< LicenseMemoryStorage > ptr_t
Definition: LicenseMemoryStorage.h:22
LicenseSpring::LicenseMemoryStorage
Simple class that saves license in a variable, implements LicenseStorage interface.
Definition: LicenseMemoryStorage.h:19
LS_API
#define LS_API
Definition: APIDef.h:23
LicenseStorage.h
LicenseSpring::LicenseStorage
LicenseStorage interface.
Definition: LicenseStorage.h:17