iceberg-cpp
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
visit_type.h File Reference

Visitor pattern for Iceberg types Adapted from Apache Arrow https://github.com/apache/arrow/blob/main/cpp/src/arrow/visit_type_inline.h. More...

#include <utility>
#include "iceberg/result.h"
#include "iceberg/type.h"
#include "iceberg/util/checked_cast.h"
#include "iceberg/util/visitor_generate.h"

Go to the source code of this file.

Namespaces

namespace  iceberg
 Core Apache Iceberg C++ APIs.
 

Macros

#define TYPE_VISIT_INLINE(TYPE_CLASS)
 
#define TYPE_VISIT_INLINE(TYPE_CLASS)
 
#define TYPE_ID_VISIT_INLINE(TYPE_CLASS)
 
#define SCHEMA_VISIT_ACTION(TYPE_CLASS)
 

Functions

template<typename VISITOR , typename... ARGS>
Status iceberg::VisitTypeInline (const Type &type, VISITOR *visitor, ARGS &&... args)
 Calls visitor with the corresponding concrete type class.
 
template<typename VISITOR , typename... ARGS>
auto iceberg::VisitType (const Type &type, VISITOR &&visitor, ARGS &&... args) -> decltype(std::forward< VISITOR >(visitor)(type, args...))
 Call visitor with the corresponding concrete type class.
 
template<typename VISITOR , typename... ARGS>
Status iceberg::VisitTypeIdInline (TypeId id, VISITOR *visitor, ARGS &&... args)
 Calls visitor with a nullptr of the corresponding concrete type class.
 
template<typename VISITOR , typename... ARGS>
auto iceberg::VisitTypeCategory (const Type &type, VISITOR *visitor, ARGS &&... args)
 Visit a type using a categorical visitor pattern.
 

Detailed Description

Visitor pattern for Iceberg types Adapted from Apache Arrow https://github.com/apache/arrow/blob/main/cpp/src/arrow/visit_type_inline.h.

Macro Definition Documentation

◆ SCHEMA_VISIT_ACTION

#define SCHEMA_VISIT_ACTION (   TYPE_CLASS)
Value:
return visitor->Visit##TYPE_CLASS( \
internal::checked_cast<const TYPE_CLASS##Type&>(type), \
std::forward<ARGS>(args)...);

◆ TYPE_ID_VISIT_INLINE

#define TYPE_ID_VISIT_INLINE (   TYPE_CLASS)
Value:
case TYPE_CLASS##Type::kTypeId: { \
const TYPE_CLASS##Type* concrete_ptr = nullptr; \
return visitor->Visit(concrete_ptr, std::forward<ARGS>(args)...); \
}

◆ TYPE_VISIT_INLINE [1/2]

#define TYPE_VISIT_INLINE (   TYPE_CLASS)
Value:
case TYPE_CLASS##Type::kTypeId: \
return visitor->Visit( \
iceberg::internal::checked_cast<const TYPE_CLASS##Type&>(type), \
std::forward<ARGS>(args)...);

◆ TYPE_VISIT_INLINE [2/2]

#define TYPE_VISIT_INLINE (   TYPE_CLASS)
Value:
case TYPE_CLASS##Type::kTypeId: \
return std::forward<VISITOR>(visitor)( \
internal::checked_cast<const TYPE_CLASS##Type&>(type), \
std::forward<ARGS>(args)...);