mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Protected Attributes | Private Member Functions | Friends
m::Date Struct Reference

The date type. More...

#include <Type.hpp>

Inheritance diagram for m::Date:
[legend]
Collaboration diagram for m::Date:
[legend]

Public Types

template<typename T >
using Pooled = m::Pooled< T, Pool< Type > >
 

Public Member Functions

 Date (Date &&)=default
 
void accept (TypeVisitor &v) override
 
void accept (ConstTypeVisitor &v) const override
 
bool operator== (const Type &other) const override
 
uint64_t size () const override
 Compute the size in bits of an instance of this type.
 
uint64_t alignment () const override
 Compute the alignment requirement in bits of an instance of this type.
 
uint64_t hash () const override
 Compute the 64 bit hash of this Type.
 
void print (std::ostream &out) const override
 Print a textual representation of this Type to out.
 
void dump (std::ostream &out) const override
 
virtual const PrimitiveTypeas_scalar () const override
 Convert this PrimitiveType to its scalar equivalent.
 
virtual const PrimitiveTypeas_vectorial () const override
 Convert this PrimitiveType to its vectorial equivalent.
 
virtual void dump (std::ostream &out) const=0
 
void dump () const
 
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.
 
 M_DECLARE_ENUM (category_t)
 a category for whether this type is scalar or vectorial
 
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.
 

Static Public Member Functions

static M_LCOV_EXCL_STOP Pooled< ErrorTypeGet_Error ()
 Returns a ErrorType.
 
static Pooled< NoneTypeGet_None ()
 Returns a NoneType.
 
static Pooled< BooleanGet_Boolean (category_t category)
 Returns a Boolean type of the given category.
 
static Pooled< BitmapGet_Bitmap (category_t category, std::size_t length)
 Returns a Bitmap type of the given category and length.
 
static Pooled< CharacterSequenceGet_Char (category_t category, std::size_t length)
 Returns a CharacterSequence type of the given category and fixed length.
 
static Pooled< CharacterSequenceGet_Varchar (category_t category, std::size_t length)
 Returns a CharacterSequence type of the given category and varying length.
 
static Pooled< DateGet_Date (category_t category)
 Returns a Date type of the given category.
 
static Pooled< DateTimeGet_Datetime (category_t category)
 Returns a DateTime type of the given category.
 
static Pooled< NumericGet_Decimal (category_t category, unsigned digits, unsigned scale)
 Returns a Numeric type for decimals of given category, decimal digits, and scale.
 
static Pooled< NumericGet_Integer (category_t category, unsigned num_bytes)
 Returns a Numeric type for integrals of given category and num_bytes bytes.
 
static Pooled< NumericGet_Float (category_t category)
 Returns a Numeric type of given category for 32 bit floating-points.
 
static Pooled< NumericGet_Double (category_t category)
 Returns a Numeric type of given category for 64 bit floating-points.
 
static Pooled< FnTypeGet_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) }
 

‍declaration for constexpr static field, see C++17 inline variables


 
static Pool< Typetypes_
 a pool of internalized, parameterized types
 

Private Member Functions

 Date (category_t category)
 

Friends

struct Type
 

Detailed Description

The date type.

Definition at line 334 of file Type.hpp.

Member Typedef Documentation

◆ Pooled

template<typename T >
using m::Type::Pooled = m::Pooled<T, Pool<Type> >
inherited

Definition at line 58 of file Type.hpp.

Constructor & Destructor Documentation

◆ Date() [1/2]

m::Date::Date ( category_t  category)
inlineprivate

Definition at line 339 of file Type.hpp.

◆ Date() [2/2]

m::Date::Date ( Date &&  )
default

Member Function Documentation

◆ accept() [1/2]

void m::Date::accept ( ConstTypeVisitor v) const
overridevirtual

Implements m::Type.

◆ accept() [2/2]

void m::Date::accept ( TypeVisitor &  v)
overridevirtual

Implements m::Type.

◆ alignment()

uint64_t m::Date::alignment ( ) const
inlineoverridevirtual

Compute the alignment requirement in bits of an instance of this type.

Reimplemented from m::Type.

Definition at line 350 of file Type.hpp.

◆ as_scalar()

virtual const PrimitiveType * m::Date::as_scalar ( ) const
overridevirtual

Convert this PrimitiveType to its scalar equivalent.

Implements m::PrimitiveType.

◆ as_vectorial()

virtual const PrimitiveType * m::Date::as_vectorial ( ) const
overridevirtual

Convert this PrimitiveType to its vectorial equivalent.

Implements m::PrimitiveType.

◆ dump() [1/3]

M_LCOV_EXCL_START void Type::dump ( ) const

Definition at line 104 of file Type.cpp.

◆ dump() [2/3]

void m::Date::dump ( std::ostream &  out) const
overridevirtual

Implements m::Type.

◆ dump() [3/3]

virtual void m::Type::dump ( std::ostream &  out) const
virtual

Implements m::Type.

◆ Get_Bitmap()

Type::Pooled< Bitmap > Type::Get_Bitmap ( category_t  category,
std::size_t  length 
)
staticinherited

◆ Get_Boolean()

Type::Pooled< Boolean > Type::Get_Boolean ( category_t  category)
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().

◆ Get_Char()

Type::Pooled< CharacterSequence > Type::Get_Char ( category_t  category,
std::size_t  length 
)
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().

◆ Get_Date()

Type::Pooled< Date > Type::Get_Date ( category_t  category)
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().

◆ Get_Datetime()

Type::Pooled< DateTime > Type::Get_Datetime ( category_t  category)
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().

◆ Get_Decimal()

Type::Pooled< Numeric > Type::Get_Decimal ( category_t  category,
unsigned  digits,
unsigned  scale 
)
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().

◆ Get_Double()

Type::Pooled< Numeric > Type::Get_Double ( category_t  category)
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().

◆ Get_Error()

Type::Pooled< ErrorType > Type::Get_Error ( )
staticinherited

Returns a ErrorType.

Definition at line 64 of file Type.cpp.

References m::Type::types_.

Referenced by m::ast::Parser::parse_data_type().

◆ Get_Float()

Type::Pooled< Numeric > Type::Get_Float ( category_t  category)
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().

◆ Get_Function()

Type::Pooled< FnType > Type::Get_Function ( const Type return_type,
std::vector< const Type * >  parameter_types 
)
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_.

◆ Get_Integer()

Type::Pooled< Numeric > Type::Get_Integer ( category_t  category,
unsigned  num_bytes 
)
staticinherited

◆ Get_None()

Type::Pooled< NoneType > Type::Get_None ( )
staticinherited

Returns a NoneType.

Definition at line 66 of file Type.cpp.

References m::Type::types_.

◆ Get_Varchar()

Type::Pooled< CharacterSequence > Type::Get_Varchar ( category_t  category,
std::size_t  length 
)
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().

◆ hash()

uint64_t m::Date::hash ( ) const
overridevirtual

Compute the 64 bit hash of this Type.

Implements m::Type.

◆ is_bitmap()

bool m::Type::is_bitmap ( ) const
inlineinherited

Definition at line 76 of file Type.hpp.

Referenced by m::storage::DataLayout::INode::add_leaf().

◆ is_boolean()

bool m::Type::is_boolean ( ) const
inlineinherited

◆ is_character_sequence()

bool m::Type::is_character_sequence ( ) const
inlineinherited

Definition at line 77 of file Type.hpp.

Referenced by m::StackMachine::emit_Cast(), m::is_comparable(), and tystr().

◆ is_date()

bool m::Type::is_date ( ) const
inlineinherited

Definition at line 78 of file Type.hpp.

Referenced by m::StackMachine::emit_Print(), m::is_comparable(), and tystr().

◆ is_date_time()

bool m::Type::is_date_time ( ) const
inlineinherited

Definition at line 79 of file Type.hpp.

Referenced by m::StackMachine::emit_Print(), m::is_comparable(), and tystr().

◆ is_decimal()

bool m::Type::is_decimal ( ) const
inlineinherited

Definition at line 506 of file Type.hpp.

◆ is_double()

bool m::Type::is_double ( ) const
inlineinherited

Returns true iff this type is a 64 bit floating-point type.

Definition at line 524 of file Type.hpp.

References m::and.

◆ is_error()

bool m::Type::is_error ( ) const
inlineinherited

Definition at line 71 of file Type.hpp.

◆ is_float()

bool m::Type::is_float ( ) const
inlineinherited

Returns true iff this type is a 32 bit floating-point type.

Definition at line 518 of file Type.hpp.

References m::and.

◆ is_floating_point()

bool m::Type::is_floating_point ( ) const
inlineinherited

Returns true iff this type is a floating-point type, i.e. f32 or f64.

Definition at line 512 of file Type.hpp.

◆ is_integral()

const M_TYPE_LIST bool m::Type::is_integral ( ) const
inlineinherited

Definition at line 500 of file Type.hpp.

Referenced by m::generate_primary_keys().

◆ is_none()

bool m::Type::is_none ( ) const
inlineinherited

◆ is_numeric()

bool m::Type::is_numeric ( ) const
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().

◆ is_primitive()

bool m::Type::is_primitive ( ) const
inlineinherited

Returns true iff this Type is a PrimitiveType.

Definition at line 74 of file Type.hpp.

◆ is_scalar()

bool m::PrimitiveType::is_scalar ( ) const
inlineinherited

Returns true iff this PrimitiveType is scalar, i.e. if it is for a single value.

Definition at line 168 of file Type.hpp.

◆ is_vectorial()

bool m::PrimitiveType::is_vectorial ( ) const
inlineinherited

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().

◆ M_DECLARE_ENUM()

m::Type::M_DECLARE_ENUM ( category_t  )
inherited

a category for whether this type is scalar or vectorial

◆ operator!=()

bool m::Type::operator!= ( const Type other) const
inlineinherited

Definition at line 69 of file Type.hpp.

◆ operator==()

bool m::Date::operator== ( const Type other) const
overridevirtual

Implements m::Type.

◆ print()

void m::Date::print ( std::ostream &  out) const
overridevirtual

Print a textual representation of this Type to out.

Implements m::Type.

◆ size()

uint64_t m::Date::size ( ) const
inlineoverridevirtual

Compute the size in bits of an instance of this type.

Reimplemented from m::Type.

Definition at line 349 of file Type.hpp.

Friends And Related Function Documentation

◆ Type

friend struct Type
friend

Definition at line 336 of file Type.hpp.

Field Documentation

◆ category

category_t m::PrimitiveType::category
inherited

whether this type is scalar or vector

Definition at line 160 of file Type.hpp.

Referenced by m::arithmetic_join().

◆ CATEGORY_TO_STR_

constexpr const char * Type::CATEGORY_TO_STR_ = { M_ENUM_TO_STR(category_t) }
staticconstexprprotectedinherited

‍declaration for constexpr static field, see C++17 inline variables

Definition at line 50 of file Type.hpp.

◆ types_

Pool< Type > Type::types_
staticprotectedinherited

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