Awkward Array: include/awkward/virtual/ArrayCache.h Source File

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 {
17 class LIBAWKWARD_EXPORT_SYMBOL ArrayCache {
18 public:
25 static const std::string
26 newkey();
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_
Content.h
awkward::ArrayCache
Abstract superclass of cache for VirtualArray, defining the interface.
Definition: ArrayCache.h:17
awkward::ArrayCache::get
virtual ContentPtr get(const std::string &key) const =0
Attempts to get an array; may be nullptr if not available.
awkward::ArrayCache::newkey
static const std::string newkey()
Returns a new key that is globally unique in the current process.
awkward::ArrayCache::is_broken
virtual bool is_broken() const =0
Returns true if the cache cannot be used for any reason.
awkward::ArrayCache::tostring_part
virtual const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const =0
awkward::ArrayCache::set
virtual void set(const std::string &key, const ContentPtr &value)=0
Writes or overwrites an array at key.
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward
Definition: BitMaskedArray.h:15
awkward::ContentPtr
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
awkward::ArrayCachePtr
std::shared_ptr< ArrayCache > ArrayCachePtr
Definition: Content.h:21