Metall
v0.29
A persistent memory allocator for data-centric analytics
json_open.cpp
This is an example of how to open an already created JSON object.
#include <iostream>
#include <
metall/metall.hpp
>
#include <
metall/json/json.hpp
>
using
metall_value_type
=
metall::json::value<metall::manager::allocator_type<std::byte>
>;
int
main
() {
std::cout <<
"Open"
<< std::endl;
{
metall::manager
manager
(metall::open_read_only,
"./test"
);
auto
*value =
manager
.find<
metall_value_type
>(metall::unique_instance).first;
metall::json::pretty_print
(std::cout, *value);
}
{
metall::manager
manager
(metall::open_only,
"./test"
);
manager
.destroy<
metall_value_type
>(metall::unique_instance);
}
return
0;
}
metall::basic_manager
A generalized Metall manager class.
Definition:
basic_manager.hpp:40
metall::json::value
JSON value. A container that holds a single bool, int64, uint64, double, JSON string,...
Definition:
value.hpp:82
json.hpp
main
int main()
Definition:
json_open.cpp:8
metall.hpp
metall::json::pretty_print
void pretty_print(std::ostream &os, const value< allocator_type > &json_value)
Pretty-prints a JSON value.
Definition:
pretty_print.hpp:75
metall::manager
basic_manager<> manager
Default Metall manager class which is an alias of basic_manager with the default template parameters.
Definition:
metall.hpp:34
Generated by
1.9.1