uzuki2
Recovering R lists faithfully from HDF5 or JSON
All Classes Namespaces Files Functions Variables Enumerations Pages
ParsedList.hpp
Go to the documentation of this file.
1#ifndef UZUKI2_PARSED_LIST_HPP
2#define UZUKI2_PARSED_LIST_HPP
3
4#include <memory>
5
6#include "interfaces.hpp"
7#include "Version.hpp"
8
14namespace uzuki2 {
15
19struct ParsedList {
20public:
24 ParsedList(std::shared_ptr<Base> p, Version v) : version(std::move(v)), ptr(std::move(p)) {}
32 Version version;
33
37 std::shared_ptr<Base> ptr;
38
39public:
43 // Provided for back-compatibility only.
44 Base* get() const {
45 return ptr.get();
46 }
47
48 Base& operator*() const {
49 return *ptr;
50 }
51
52 Base* operator->() const {
53 return ptr.operator->();
54 }
55
56 operator bool() const {
57 return ptr.operator bool();
58 }
59
60 template<typename ...Args_>
61 void reset(Args_&& ... args) const {
62 ptr.reset(std::forward<Args_>(args)...);
63 }
67};
68
69}
70
71#endif
Base interface for all R objects.
Definition interfaces.hpp:50
Defines the interfaces to use in HDF5 parsing.
Parse an R list from a HDF5 or JSON file.
Definition parse_json.hpp:28
Results of parsing a list from file.
Definition ParsedList.hpp:19
Version version
Definition ParsedList.hpp:32
std::shared_ptr< Base > ptr
Definition ParsedList.hpp:37