Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE
2
3#ifndef AWKWARD_UTIL_H_
4#define AWKWARD_UTIL_H_
5
6#include <string>
7#include <vector>
8#include <map>
9#include <memory>
10
11#include "awkward/common.h"
12
13#ifndef _MSC_VER
14 #include "dlfcn.h"
15#endif
16
17namespace awkward {
18 namespace util {
22 enum class EXPORT_SYMBOL dtype {
42 size
43 };
44
46 EXPORT_SYMBOL const std::string
47 dtype_to_name(dtype dt);
48
50 EXPORT_SYMBOL const std::string
51 dtype_to_format(dtype dt, const std::string& format = "");
52
63 std::string
64 quote(const std::string& x);
65
67 enum class EXPORT_SYMBOL ForthError {
68 // execution can continue
70
71 // execution cannot continue
87
88 size
89 };
90
102 template <typename T>
104 public:
107 void
108 operator()(T const* ptr) {
109 uint8_t const* in = reinterpret_cast<uint8_t const*>(ptr);
110 delete [] in;
111 }
112 };
113
114 }
115}
116
117#endif // AWKWARD_UTIL_H_
Used as a std::shared_ptr deleter (second argument) to overload delete ptr with delete[] ptr.
Definition util.h:103
void operator()(T const *ptr)
Called by std::shared_ptr when its reference count reaches zero.
Definition util.h:108
#define EXPORT_SYMBOL
Definition common.h:25
std::string quote(const std::string &x)
Puts quotation marks around a string and escapes the appropriate characters.
EXPORT_SYMBOL const std::string dtype_to_format(dtype dt, const std::string &format="")
Convert a dtype enum into a NumPy format string.
EXPORT_SYMBOL const std::string dtype_to_name(dtype dt)
Returns the name associated with a given dtype.
Definition ArrayBuilder.h:14
timedelta64
Definition util.h:41
quoted_string_missing
Definition util.h:85
division_by_zero
Definition util.h:82
uint64
Definition util.h:32
int16
Definition util.h:26
user_halt
Definition util.h:74
uint8
Definition util.h:29
varint_too_big
Definition util.h:83
int64
Definition util.h:28
stack_overflow
Definition util.h:77
recursion_depth_exceeded
Definition util.h:75
int8
Definition util.h:25
not_ready
Definition util.h:72
complex256
Definition util.h:39
float16
Definition util.h:33
float64
Definition util.h:35
boolean
Definition util.h:24
enumeration_missing
Definition util.h:86
uint32
Definition util.h:31
float128
Definition util.h:36
read_beyond
Definition util.h:78
NOT_PRIMITIVE
Definition util.h:23
datetime64
Definition util.h:40
uint16
Definition util.h:30
skip_beyond
Definition util.h:80
none
Definition util.h:69
text_number_missing
Definition util.h:84
seek_beyond
Definition util.h:79
rewind_beyond
Definition util.h:81
int32
Definition util.h:27
is_done
Definition util.h:73
complex64
Definition util.h:37
complex128
Definition util.h:38
stack_underflow
Definition util.h:76
float32
Definition util.h:34