taco-db  0.1.0
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
taco::DatumRef Class Reference

A DatumRef object is a read-only reference to an C++ object of a supported runtime type. More...

#include <base/datum.h>

Inheritance diagram for taco::DatumRef:
taco::datum_impl::DatumRefVarlenGetters< DatumRef > taco::datum_impl::NonVarlenGetters< DatumImpl >

Public Member Functions

 DatumRef (const Datum &d)
 
 DatumRef (const DatumRef &)=default
 
DatumRefoperator= (const DatumRef &)=default
 
constexpr bool isnull () const
 
- Public Member Functions inherited from taco::datum_impl::DatumRefVarlenGetters< DatumRef >
constexpr const char * GetVarlenBytes () const
 Returns the variable-length value of a datum as an array of bytes. More...
 
constexpr uint32_t GetVarlenSize () const
 Returns the length of the variable-length value of a datum. More...
 
constexpr absl::string_view GetVarlenAsStringView () const
 
constexpr DatumGetDatum () const
 Returns a reference to the underlying datum if this references one with a variable-length value. More...
 
Datum DeepCopy (bool isbyref) const
 Returns a new Datum that is a deep copy of the underlying datum. More...
 
- Public Member Functions inherited from taco::datum_impl::NonVarlenGetters< DatumImpl >
constexpr const char * GetFixedlenBytes () const
 Return the pointer to the binary representation of a fixed-length datum that is passed by value. More...
 
constexpr bool GetBool () const
 Returns boolean value of a datum. More...
 
constexpr char GetChar () const
 Returns character value of a datum. More...
 
constexpr int8_t GetInt8 () const
 Returns 8-bit integer value of a datum. More...
 
constexpr uint8_t GetUInt8 () const
 Returns 8-bit unsigned integer value of a datum. More...
 
constexpr int16_t GetInt16 () const
 Returns 16-bit integer value of a datum. More...
 
constexpr uint16_t GetUInt16 () const
 Returns 16-bit unsigned integer value of a datum. More...
 
constexpr int32_t GetInt32 () const
 Returns 32-bit integer value of a datum. More...
 
constexpr uint32_t GetUInt32 () const
 Returns 32-bit unsigned integer value of a datum. More...
 
constexpr Oid GetOid () const
 Returns object identifier value of a datum. More...
 
constexpr int64_t GetInt64 () const
 Returns 64-bit integer value of a datum. More...
 
constexpr uint64_t GetUInt64 () const
 Returns 64-bit unsigned integer value of a datum. More...
 
constexpr float GetFloat () const
 Returns single-precision floating point value of a datum. More...
 
constexpr double GetDouble () const
 Returns double-precision floating point value of a datum. More...
 
constexpr void * GetPointer () const
 Returns pointer value of a datum. More...
 
template<class T >
constexpr T * GetPointerAs () const
 Returns the pointer value of a datum as const T*. More...
 

Protected Member Functions

 DatumRef (datum_impl::DatumRep val)
 
- Protected Member Functions inherited from taco::datum_impl::NonVarlenGetters< DatumImpl >
constexpr const DatumRepval () const
 

Protected Attributes

datum_impl::DatumRep m_val
 

Friends

class datum_impl::NonVarlenGetters< DatumRef >
 
class NullableDatumRef
 

Detailed Description

A DatumRef object is a read-only reference to an C++ object of a supported runtime type.

There is an implicit conversion from a Datum to DatumRef so that one may use a Datum variable where it needs a DatumRef. The object referenced by a DatumRef is always assumed to be non-null.

DatumRef makes a copy of the actual value stored in its referencing Datum unless the value is variable length with the length field (i.e., the pointer to a null-terminated string still get copied into a DatumRef). In the case that the value is a variable length field, DatumRef stores a pointer to the referencing Datum, which requires an additional indirection when read. Note that the nullness of the referencing Datum is always ignored, even if we store a pointer here.

Constructor & Destructor Documentation

◆ DatumRef() [1/3]

taco::DatumRef::DatumRef ( const Datum d)
inline

◆ DatumRef() [2/3]

taco::DatumRef::DatumRef ( const DatumRef )
default

◆ DatumRef() [3/3]

taco::DatumRef::DatumRef ( datum_impl::DatumRep  val)
inlineprotected

Member Function Documentation

◆ isnull()

constexpr bool taco::DatumRef::isnull ( ) const
inlineconstexpr

◆ operator=()

DatumRef& taco::DatumRef::operator= ( const DatumRef )
default

Friends And Related Function Documentation

◆ datum_impl::NonVarlenGetters< DatumRef >

friend class datum_impl::NonVarlenGetters< DatumRef >
friend

◆ NullableDatumRef

friend class NullableDatumRef
friend

Member Data Documentation

◆ m_val

datum_impl::DatumRep taco::DatumRef::m_val
protected

The documentation for this class was generated from the following file: