Awkward Array: include/awkward/type/OptionType.h Source File

Loading...
Searching...
No Matches
OptionType.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_OPTIONTYPE_H_
4#define AWKWARD_OPTIONTYPE_H_
5
6#include "awkward/common.h"
7#include "awkward/util.h"
8#include "awkward/type/Type.h"
9
10namespace awkward {
18 class LIBAWKWARD_EXPORT_SYMBOL OptionType: public Type {
19 public:
27 OptionType(const util::Parameters& parameters,
28 const std::string& typestr,
29 const TypePtr& type);
30
32 const TypePtr
33 type() const;
34
35 std::string
36 tostring_part(const std::string& indent,
37 const std::string& pre,
38 const std::string& post) const override;
39
40 const TypePtr
41 shallow_copy() const override;
42
43 bool
44 equal(const TypePtr& other, bool check_parameters) const override;
45
46 int64_t
47 numfields() const override;
48
49 int64_t
50 fieldindex(const std::string& key) const override;
51
52 const std::string
53 key(int64_t fieldindex) const override;
54
55 bool
56 haskey(const std::string& key) const override;
57
58 const std::vector<std::string>
59 keys() const override;
60
61 const ContentPtr
62 empty() const override;
63
64 private:
66 const TypePtr type_;
67 };
68}
69
70#endif // AWKWARD_OPTIONTYPE_H_
Type.h
awkward::OptionType
Describes the high level type of data with possible missing values, represented by None in python.
Definition: OptionType.h:18
awkward::OptionType::tostring_part
std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
Internal function to build an output string for tostring.
awkward::OptionType::shallow_copy
const TypePtr shallow_copy() const override
Copies this Type without copying any hierarchically nested types.
awkward::OptionType::OptionType
OptionType(const util::Parameters &parameters, const std::string &typestr, const TypePtr &type)
Create an OptionType with a full set of parameters.
awkward::OptionType::fieldindex
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordType.
awkward::OptionType::empty
const ContentPtr empty() const override
Returns an empty array (Content) with this type.
awkward::OptionType::keys
const std::vector< std::string > keys() const override
A list of RecordType keys or an empty list if this type does not contain a RecordType.
awkward::OptionType::key
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
awkward::OptionType::numfields
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
awkward::OptionType::haskey
bool haskey(const std::string &key) const override
Returns true if the type contains a RecordType with the specified key; false otherwise.
awkward::OptionType::type
const TypePtr type() const
The Type of the non-missing data.
awkward::OptionType::equal
bool equal(const TypePtr &other, bool check_parameters) const override
Returns true if this type is equal to other; false otherwise.
awkward::Type
Abstract superclass of all high level types (flat hierarchy).
Definition: Type.h:23
common.h
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward::util::Parameters
std::map< std::string, std::string > Parameters
Definition: util.h:165
awkward
Definition: BitMaskedArray.h:15
awkward::ContentPtr
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
awkward::TypePtr
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
util.h