![]() |
mutable
A Database System for Research and Fast Prototyping
|
PrimitiveType
s represent Type
s of values.
More...
#include <Type.hpp>
Public Types | |
template<typename T > | |
using | Pooled = m::Pooled< T, Pool< Type > > |
Public Member Functions | |
PrimitiveType (category_t category) | |
PrimitiveType (const PrimitiveType &)=delete | |
PrimitiveType (PrimitiveType &&)=default | |
virtual | ~PrimitiveType () |
bool | is_scalar () const |
Returns true iff this PrimitiveType is scalar, i.e. if it is for a single value. | |
bool | is_vectorial () const |
Returns true iff this PrimitiveType is vectorial, i.e. if it is for a sequence of values. | |
virtual const PrimitiveType * | as_scalar () const =0 |
Convert this PrimitiveType to its scalar equivalent. | |
virtual const PrimitiveType * | as_vectorial () const =0 |
Convert this PrimitiveType to its vectorial equivalent. | |
M_DECLARE_ENUM (category_t) | |
a category for whether this type is scalar or vectorial | |
virtual void | accept (TypeVisitor &v)=0 |
virtual void | accept (ConstTypeVisitor &v) const =0 |
virtual bool | operator== (const Type &other) const =0 |
bool | operator!= (const Type &other) const |
bool | is_error () const |
bool | is_none () const |
bool | is_primitive () const |
Returns true iff this Type is a PrimitiveType . | |
bool | is_boolean () const |
bool | is_bitmap () const |
bool | is_character_sequence () const |
bool | is_date () const |
bool | is_date_time () const |
bool | is_numeric () const |
Returns true iff this Type is a Numeric type. | |
bool | is_integral () const |
bool | is_decimal () const |
bool | is_floating_point () const |
Returns true iff this type is a floating-point type, i.e. f32 or f64 . | |
bool | is_float () const |
Returns true iff this type is a 32 bit floating-point type. | |
bool | is_double () const |
Returns true iff this type is a 64 bit floating-point type. | |
virtual uint64_t | size () const |
Compute the size in bits of an instance of this type. | |
virtual uint64_t | alignment () const |
Compute the alignment requirement in bits of an instance of this type. | |
virtual uint64_t | hash () const =0 |
Compute the 64 bit hash of this Type . | |
virtual void | print (std::ostream &out) const =0 |
Print a textual representation of this Type to out . | |
virtual void | dump (std::ostream &out) const =0 |
void | dump () const |
Static Public Member Functions | |
static M_LCOV_EXCL_STOP Pooled< ErrorType > | Get_Error () |
Returns a ErrorType . | |
static Pooled< NoneType > | Get_None () |
Returns a NoneType . | |
static Pooled< Boolean > | Get_Boolean (category_t category) |
Returns a Boolean type of the given category . | |
static Pooled< Bitmap > | Get_Bitmap (category_t category, std::size_t length) |
Returns a Bitmap type of the given category and length . | |
static Pooled< CharacterSequence > | Get_Char (category_t category, std::size_t length) |
Returns a CharacterSequence type of the given category and fixed length . | |
static Pooled< CharacterSequence > | Get_Varchar (category_t category, std::size_t length) |
Returns a CharacterSequence type of the given category and varying length . | |
static Pooled< Date > | Get_Date (category_t category) |
Returns a Date type of the given category . | |
static Pooled< DateTime > | Get_Datetime (category_t category) |
Returns a DateTime type of the given category . | |
static Pooled< Numeric > | Get_Decimal (category_t category, unsigned digits, unsigned scale) |
Returns a Numeric type for decimals of given category , decimal digits , and scale . | |
static Pooled< Numeric > | Get_Integer (category_t category, unsigned num_bytes) |
Returns a Numeric type for integrals of given category and num_bytes bytes. | |
static Pooled< Numeric > | Get_Float (category_t category) |
Returns a Numeric type of given category for 32 bit floating-points. | |
static Pooled< Numeric > | Get_Double (category_t category) |
Returns a Numeric type of given category for 64 bit floating-points. | |
static Pooled< FnType > | Get_Function (const Type *return_type, std::vector< const Type * > parameter_types) |
Returns a FnType for a function with parameter types parameter_types and return type return_type . | |
Data Fields | |
category_t | category |
whether this type is scalar or vector | |
Static Protected Attributes | |
static constexpr const char * | CATEGORY_TO_STR_ [] = { M_ENUM_TO_STR(category_t) } |
| |
static Pool< Type > | types_ |
a pool of internalized, parameterized types | |
PrimitiveType
s represent Type
s of values.
|
inline |
|
delete |
|
default |
|
pure virtualinherited |
Implemented in m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, and m::FnType.
|
pure virtualinherited |
Implemented in m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, and m::FnType.
|
inlinevirtualinherited |
Compute the alignment requirement in bits of an instance of this type.
Reimplemented in m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, and m::Numeric.
Definition at line 95 of file Type.hpp.
Referenced by m::PaxStore::compute_block_offsets(), and m::RowStore::compute_offsets().
|
pure virtual |
Convert this PrimitiveType
to its scalar equivalent.
Implemented in m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, and m::Numeric.
|
pure virtual |
Convert this PrimitiveType
to its vectorial equivalent.
Implemented in m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, and m::Numeric.
Referenced by m::execute_statement().
|
inherited |
|
pure virtualinherited |
Implemented in m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, m::FnType, m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, and m::FnType.
|
staticinherited |
Returns a Bitmap
type of the given category
and length
.
Definition at line 70 of file Type.cpp.
References m::Type::types_.
Referenced by m::wasm::ChainedHashTable< IsGlobal >::ChainedHashTable(), m::storage::RowLayoutFactory::make(), m::storage::PAXLayoutFactory::make(), and m::wasm::OpenAddressingHashTable< IsGlobal, ValueInPlace >::OpenAddressingHashTable().
|
staticinherited |
Returns a Boolean
type of the given category
.
Definition at line 68 of file Type.cpp.
References m::Type::types_.
Referenced by M_LCOV_EXCL_STOP::apply_timestamp_filter(), and m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a CharacterSequence
type of the given category
and fixed length
.
Definition at line 75 of file Type.cpp.
References m::Type::types_.
Referenced by m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a Date
type of the given category
.
Definition at line 85 of file Type.cpp.
References m::Type::types_.
Referenced by m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a DateTime
type of the given category
.
Definition at line 87 of file Type.cpp.
References m::Type::types_.
Referenced by m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a Numeric
type for decimals of given category
, decimal digits
, and scale
.
Definition at line 89 of file Type.cpp.
References m::Type::types_.
Referenced by m::arithmetic_join(), and m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a Numeric
type of given category
for 64 bit floating-points.
Definition at line 104 of file Type.cpp.
Referenced by m::arithmetic_join(), compute_aggregate_info(), m::get_runtime_type(), and m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a ErrorType
.
Definition at line 64 of file Type.cpp.
References m::Type::types_.
Referenced by m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a Numeric
type of given category
for 32 bit floating-points.
Definition at line 99 of file Type.cpp.
References m::Type::types_.
Referenced by m::arithmetic_join(), m::get_runtime_type(), and m::ast::Parser::parse_data_type().
|
staticinherited |
Returns a FnType
for a function with parameter types parameter_types
and return type return_type
.
Definition at line 109 of file Type.cpp.
References m::Type::types_.
|
staticinherited |
Returns a Numeric
type for integrals of given category
and num_bytes
bytes.
Definition at line 94 of file Type.cpp.
References m::Type::types_.
Referenced by M_LCOV_EXCL_STOP::apply_timestamp_filter(), m::arithmetic_join(), m::wasm::ChainedHashTable< IsGlobal >::ChainedHashTable(), compute_aggregate_info(), m::wasm::HashBasedGroupJoin::execute(), generate_training_suite_filter(), generate_training_suite_group_by(), generate_training_suite_join(), m::get_runtime_type(), m::MultiVersioningTable::MultiVersioningTable(), m::wasm::OpenAddressingHashTable< IsGlobal, ValueInPlace >::OpenAddressingHashTable(), and m::ast::Parser::parse_data_type().
|
staticinherited |
|
staticinherited |
Returns a CharacterSequence
type of the given category
and varying length
.
Definition at line 80 of file Type.cpp.
References m::Type::types_.
Referenced by m::ast::Parser::parse_data_type().
|
pure virtualinherited |
Compute the 64 bit hash of this Type
.
Implemented in m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, and m::FnType.
Referenced by std::hash< m::Type >::operator()().
|
inlineinherited |
Definition at line 76 of file Type.hpp.
Referenced by m::storage::DataLayout::INode::add_leaf().
|
inlineinherited |
Definition at line 75 of file Type.hpp.
Referenced by m::storage::DataLayout::INode::add_leaf(), m::StackMachine::emit_Ld(), m::StackMachine::emit_St(), m::is_comparable(), and tystr().
|
inlineinherited |
Definition at line 77 of file Type.hpp.
Referenced by m::StackMachine::emit_Cast(), m::is_comparable(), and tystr().
|
inlineinherited |
Definition at line 78 of file Type.hpp.
Referenced by m::StackMachine::emit_Print(), m::is_comparable(), and tystr().
|
inlineinherited |
Definition at line 79 of file Type.hpp.
Referenced by m::StackMachine::emit_Print(), m::is_comparable(), and tystr().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 500 of file Type.hpp.
Referenced by m::generate_primary_keys().
|
inlineinherited |
Definition at line 72 of file Type.hpp.
Referenced by m::StackMachine::emit_Print(), m::StackMachine::emit_St_Tup(), and m::wasm::ExprCompiler::operator()().
|
inlineinherited |
Returns true
iff this Type
is a Numeric
type.
Definition at line 81 of file Type.hpp.
Referenced by m::StackMachine::emit_Cast(), and m::is_comparable().
|
inlineinherited |
Returns true
iff this Type
is a PrimitiveType
.
|
inline |
Returns true
iff this PrimitiveType
is scalar, i.e. if it is for a single value.
|
inline |
Returns true
iff this PrimitiveType
is vectorial, i.e. if it is for a sequence of values.
Definition at line 170 of file Type.hpp.
Referenced by m::Attribute::Attribute().
|
inherited |
a category for whether this type is scalar or vectorial
|
inlineinherited |
|
pure virtualinherited |
Implemented in m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, and m::FnType.
|
pure virtualinherited |
Print a textual representation of this Type
to out
.
Implemented in m::ErrorType, m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, m::Numeric, and m::FnType.
|
inlinevirtualinherited |
Compute the size in bits of an instance of this type.
Reimplemented in m::NoneType, m::Boolean, m::Bitmap, m::CharacterSequence, m::Date, m::DateTime, and m::Numeric.
Definition at line 92 of file Type.hpp.
Referenced by m::PaxStore::compute_block_offsets(), and m::RowStore::compute_offsets().
category_t m::PrimitiveType::category |
whether this type is scalar or vector
Definition at line 160 of file Type.hpp.
Referenced by m::arithmetic_join().
|
staticconstexprprotectedinherited |
a pool of internalized, parameterized types
Definition at line 54 of file Type.hpp.
Referenced by m::ErrorType::dump(), m::Type::Get_Bitmap(), m::Type::Get_Boolean(), m::Type::Get_Char(), m::Type::Get_Date(), m::Type::Get_Datetime(), m::Type::Get_Decimal(), m::Type::Get_Error(), m::Type::Get_Float(), m::Type::Get_Function(), m::Type::Get_Integer(), m::Type::Get_None(), and m::Type::Get_Varchar().