MCPcopy Create free account
hub / github.com/apache/arrow / ValidateEnumValue

Function ValidateEnumValue

cpp/src/arrow/compute/function_internal.h:84–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83template <typename Enum, typename CType = typename std::underlying_type<Enum>::type>
84Result<Enum> ValidateEnumValue(CType raw) {
85 for (auto valid : EnumTraits<Enum>::values()) {
86 if (raw == static_cast<CType>(valid)) {
87 return static_cast<Enum>(raw);
88 }
89 }
90 return Status::Invalid("Invalid value for ", EnumTraits<Enum>::name(), ": ", raw);
91}
92
93class ARROW_EXPORT GenericOptionsType : public FunctionOptionsType {
94 public:

Callers

nothing calls this directly

Calls 3

valuesFunction · 0.50
InvalidFunction · 0.50
nameFunction · 0.50

Tested by

no test coverage detected