Loading...
Searching...
No Matches
ArrayCache.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
2
3#ifndef AWKWARD_ARRAYCACHE_H_
4#define AWKWARD_ARRAYCACHE_H_
5
6#include "awkward/Content.h"
7
8namespace awkward {
18 public:
25 static const std::string
27
29 virtual ContentPtr
30 get(const std::string& key) const = 0;
31
33 virtual void
34 set(const std::string& key, const ContentPtr& value) = 0;
35
37 virtual bool
38 is_broken() const = 0;
39
40 virtual const std::string
41 tostring_part(const std::string& indent,
42 const std::string& pre,
43 const std::string& post) const = 0;
44 };
45
46 using ArrayCachePtr = std::shared_ptr<ArrayCache>;
47
48 // Note: if you're creating a pure C++ cache (and it's not ridiculously
49 // large), define it in this file and implement it in
50 // src/libawkward/virtual/ArrayCache.cpp.
51
52}
53
54#endif // AWKWARD_ARRAYCACHE_H_
Abstract superclass of cache for VirtualArray, defining the interface.
Definition: ArrayCache.h:17
virtual ContentPtr get(const std::string &key) const =0
Attempts to get an array; may be nullptr if not available.
static const std::string newkey()
Returns a new key that is globally unique in the current process.
virtual bool is_broken() const =0
Returns true if the cache cannot be used for any reason.
virtual const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const =0
virtual void set(const std::string &key, const ContentPtr &value)=0
Writes or overwrites an array at key.
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
Definition: BitMaskedArray.h:15
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
std::shared_ptr< ArrayCache > ArrayCachePtr
Definition: Content.h:21