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

An attribute of a table. More...

#include <Schema.hpp>

Collaboration diagram for m::Attribute:
[legend]

Public Member Functions

 Attribute (const Attribute &)=delete
 
 Attribute (Attribute &&)=default
 
bool is_unique () const
 Returns true iff this Attribute is unique, i.e.
 
bool operator== (const Attribute &other) const
 Compares to attributes.
 
bool operator!= (const Attribute &other) const
 
M_LCOV_EXCL_STOP void dump (std::ostream &out) const
 
void dump () const
 

Data Fields

std::size_t id
 the internal identifier of the attribute, unique within its table
 
const Tabletable
 the table the attribute belongs to
 
const PrimitiveTypetype
 the type of the attribute
 
ThreadSafePooledString name
 the name of the attribute
 
bool not_nullable = false
 the flag indicating whether the attribute must not be NULL
 
bool unique = false
 

‍the flag indicating whether the attribute is unique; note that a singleton primary key is also unique


 
bool is_hidden = false
 the flag indicates whether the attribute is hidden from the user
 
const Attributereference = nullptr
 the referenced attribute
 

Private Member Functions

 Attribute (std::size_t id, const Table &table, const PrimitiveType *type, ThreadSafePooledString name)
 

Friends

struct ConcreteTable
 
M_LCOV_EXCL_START friend std::ostream & operator<< (std::ostream &out, const Attribute &attr)
 

Detailed Description

An attribute of a table.

Every attribute belongs to exactly one table.

Definition at line 288 of file Schema.hpp.

Constructor & Destructor Documentation

◆ Attribute() [1/3]

m::Attribute::Attribute ( std::size_t  id,
const Table table,
const PrimitiveType type,
ThreadSafePooledString  name 
)
inlineexplicitprivate

Definition at line 303 of file Schema.hpp.

References m::PrimitiveType::is_vectorial().

◆ Attribute() [2/3]

m::Attribute::Attribute ( const Attribute )
delete

◆ Attribute() [3/3]

m::Attribute::Attribute ( Attribute &&  )
default

Member Function Documentation

◆ dump() [1/2]

void Attribute::dump ( ) const

Definition at line 75 of file Schema.cpp.

References m::Schema::dump().

◆ dump() [2/2]

M_LCOV_EXCL_START void Attribute::dump ( std::ostream &  out) const

Definition at line 67 of file Schema.cpp.

◆ is_unique()

M_LCOV_EXCL_STOP bool Attribute::is_unique ( ) const

Returns true iff this Attribute is unique, i.e.

it is either specified with an UNIQUE constraint or it is a singleton primary key of the corresponding table.

Definition at line 59 of file Schema.cpp.

References m::and.

◆ operator!=()

bool m::Attribute::operator!= ( const Attribute other) const
inline

Definition at line 323 of file Schema.hpp.

◆ operator==()

bool m::Attribute::operator== ( const Attribute other) const
inline

Compares to attributes.

Attributes are equal if they have the same id and belong to the same table.

Definition at line 322 of file Schema.hpp.

References and(), id, and table.

Friends And Related Function Documentation

◆ ConcreteTable

friend struct ConcreteTable
friend

Definition at line 290 of file Schema.hpp.

◆ operator<<

M_LCOV_EXCL_START friend std::ostream & operator<< ( std::ostream &  out,
const Attribute attr 
)
friend

Definition at line 326 of file Schema.hpp.

Field Documentation

◆ id

std::size_t m::Attribute::id

the internal identifier of the attribute, unique within its table

Definition at line 292 of file Schema.hpp.

Referenced by m::PaxStore::compute_block_offsets(), m::RowStore::compute_offsets(), m::PaxStore::offset(), m::RowStore::offset(), std::hash< m::Attribute >::operator()(), and operator==().

◆ is_hidden

bool m::Attribute::is_hidden = false

the flag indicates whether the attribute is hidden from the user

Definition at line 299 of file Schema.hpp.

◆ name

ThreadSafePooledString m::Attribute::name

the name of the attribute

Definition at line 295 of file Schema.hpp.

Referenced by m::generate_column_data(), and m::generate_correlated_column_data().

◆ not_nullable

bool m::Attribute::not_nullable = false

the flag indicating whether the attribute must not be NULL

Definition at line 296 of file Schema.hpp.

◆ reference

const Attribute* m::Attribute::reference = nullptr

the referenced attribute

Definition at line 300 of file Schema.hpp.

◆ table

const Table& m::Attribute::table

the table the attribute belongs to

Definition at line 293 of file Schema.hpp.

Referenced by std::hash< m::Attribute >::operator()(), and operator==().

◆ type

const PrimitiveType* m::Attribute::type

◆ unique

bool m::Attribute::unique = false

‍the flag indicating whether the attribute is unique; note that a singleton primary key is also unique

Definition at line 298 of file Schema.hpp.


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