Derecho  0.9
Distributed systems toolkit for RDMA
PersistNoLog.hpp
Go to the documentation of this file.
1 #ifndef PERSIST_NO_LOG_HPP
2 #define PERSIST_NO_LOG_HPP
3 
4 #if !defined(__GNUG__) && !defined(__clang__)
5 #error PersistLog.hpp only works with clang and gnu compilers
6 #endif
7 
8 #include "detail/util.hpp"
10 #include <inttypes.h>
11 #include <map>
12 #include <set>
13 #include <stdio.h>
14 #include <string>
15 
16 #include <derecho/utils/logger.hpp>
17 
18 #if __GNUC__ > 7
19 #include <filesystem>
20 namespace fs = std::filesystem;
21 #else
22 #include <experimental/filesystem>
23 namespace fs = std::experimental::filesystem;
24 #endif
25 
26 namespace persistent {
27 
32 template <typename ObjectType, StorageType storageType = ST_FILE>
34  ObjectType& obj,
35  const char* object_name) noexcept(false);
36 
37 template <typename ObjectType>
39  ObjectType& obj,
40  const char* object_name) noexcept(false) {
41  saveNoLogObjectInFile<ObjectType, ST_MEM>(obj, object_name);
42 }
43 
48 template <typename ObjectType, StorageType storageType = ST_FILE>
49 std::unique_ptr<ObjectType> loadNoLogObjectFromFile(
50  const char* object_name,
51  mutils::DeserializationManager* dm = nullptr) noexcept(false);
52 
53 template <typename ObjectType>
54 std::unique_ptr<ObjectType> loadNoLogObjectFromMem(
55  const char* object_name,
56  mutils::DeserializationManager* dm = nullptr) noexcept(false) {
57  return loadNoLogObjectFromFile<ObjectType, ST_MEM>(object_name, dm);
58 }
59 }
60 
62 
63 #endif //PERSIST_NO_LOG_HPP
This file include all common types internal to derecho and not necessarily being known by a client pr...
void saveNoLogObjectInMem(ObjectType &obj, const char *object_name) noexcept(false)
The manager for any RemoteDeserializationContexts.
std::unique_ptr< ObjectType > loadNoLogObjectFromMem(const char *object_name, mutils::DeserializationManager *dm=nullptr) noexcept(false)
std::unique_ptr< ObjectType > loadNoLogObjectFromFile(const char *object_name, mutils::DeserializationManager *dm) noexcept(false)
load data from file
void saveNoLogObjectInFile(ObjectType &obj, const char *object_name) noexcept(false)
save object in file