-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStorage
More file actions
56 lines (51 loc) · 1.26 KB
/
Copy pathStorage
File metadata and controls
56 lines (51 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* -*- c++ -*- */
///////////////////////////////////////////
// Storage
// -------------------------------------
// file : Storage
// author : Ben Kietzman
// begin : 2021-04-07
// copyright : Ben Kietzman
// email : ben@kietzman.org
///////////////////////////////////////////
/*! \file Storage
* \brief Storage Class
*
* Provides storage functionality.
*/
#ifndef _COMMON_STORAGE_
#define _COMMON_STORAGE_
// {{{ includes
#include <mutex>
using namespace std;
#include "Json"
// }}}
extern "C++"
{
namespace common
{
// {{{ Storage
class Storage
{
private:
std::mutex m_mutexStorage;
Json *m_ptStorage;
public:
Storage();
~Storage();
bool add(list<string> keys, Json *ptData, string &strError);
Json *get();
void lock();
Json *ptr();
void put(Json *ptStorage);
bool remove(list<string> keys, string &strError);
bool request(const string strAction, list<string> keys, Json *ptData, string &strError);
bool retrieve(list<string> keys, Json *ptData, string &strError);
bool retrieveKeys(list<string> keys, Json *ptData, string &strError);
void unlock();
bool update(list<string> keys, Json *ptData, string &strError);
};
// }}}
}
}
#endif