SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::DB::Schemas Class Reference

#include <swcdb/db/Columns/Schemas.h>

+ Inheritance diagram for SWC::DB::Schemas:
+ Collaboration diagram for SWC::DB::Schemas:

Classes

struct  Pattern
 
struct  SelectorPatterns
 
struct  TagsPattern
 

Public Types

typedef Core::Vector< PatternNamePatterns
 

Public Member Functions

SWC_CAN_INLINE Schemas () noexcept
 
SWC_CAN_INLINE ~Schemas () noexcept
 
uint64_t size ()
 
void add (int &err, const Schema::Ptr &schema)
 
void remove (cid_t cid)
 
void replace (const Schema::Ptr &schema)
 
Schema::Ptr get (cid_t cid) noexcept
 
Schema::Ptr get (const std::string &name) noexcept
 
void all (SchemasVec &entries)
 
void matching (const SelectorPatterns &patterns, SchemasVec &entries, bool no_sys=true)
 
void reset ()
 

Protected Member Functions

void _add (int &err, const Schema::Ptr &schema)
 
void _remove (cid_t cid)
 
void _replace (const Schema::Ptr &schema)
 
Schema::Ptr _get (cid_t cid) const noexcept
 
Schema::Ptr _get (const std::string &name) const noexcept
 

Protected Attributes

Core::MutexSptd m_mutex
 

Private Types

using Map = std::unordered_map< cid_t, Schema::Ptr >
 

Detailed Description

Definition at line 18 of file Schemas.h.

Member Typedef Documentation

◆ Map

using SWC::DB::Schemas::Map = std::unordered_map<cid_t, Schema::Ptr>
private

Definition at line 19 of file Schemas.h.

◆ NamePatterns

Definition at line 84 of file Schemas.h.

Constructor & Destructor Documentation

◆ Schemas()

SWC_CAN_INLINE SWC::DB::Schemas::Schemas ( )
inlinenoexcept

Definition at line 115 of file Schemas.h.

◆ ~Schemas()

SWC_CAN_INLINE SWC::DB::Schemas::~Schemas ( )
inlinenoexcept

Definition at line 118 of file Schemas.h.

Member Function Documentation

◆ _add()

void SWC::DB::Schemas::_add ( int &  err,
const Schema::Ptr schema 
)
protected

Definition at line 24 of file Schemas.cc.

References SWC::Error::COLUMN_SCHEMA_NAME_EXISTS, SWC::LOG_WARN, SWC::Error::print(), SWC_LOG_OSTREAM, and SWC_LOG_OUT.

Referenced by add().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _get() [1/2]

Schema::Ptr SWC::DB::Schemas::_get ( cid_t  cid) const
protectednoexcept

Definition at line 61 of file Schemas.cc.

◆ _get() [2/2]

Schema::Ptr SWC::DB::Schemas::_get ( const std::string &  name) const
protectednoexcept

Definition at line 71 of file Schemas.cc.

References SWC::Condition::str_eq().

+ Here is the call graph for this function:

◆ _remove()

void SWC::DB::Schemas::_remove ( cid_t  cid)
protected

Definition at line 39 of file Schemas.cc.

Referenced by remove().

+ Here is the caller graph for this function:

◆ _replace()

void SWC::DB::Schemas::_replace ( const Schema::Ptr schema)
protected

Definition at line 50 of file Schemas.cc.

Referenced by replace().

+ Here is the caller graph for this function:

◆ add()

void SWC::DB::Schemas::add ( int &  err,
const Schema::Ptr schema 
)

Definition at line 19 of file Schemas.cc.

References _add(), and m_mutex.

Referenced by SWC::Manager::MngdColumns::create(), SWC::Comm::Protocol::Mngr::Handler::MngrColumnGet::handle(), and SWC::Manager::MngdColumns::initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ all()

void SWC::DB::Schemas::all ( SchemasVec entries)

Definition at line 79 of file Schemas.cc.

References m_mutex, SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), size, and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().

Referenced by SWC::Comm::Protocol::Mngr::Handler::column_list(), SWC::Manager::MngdColumns::columns_load(), and SWC::Manager::Schemas::store_create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get() [1/2]

Schema::Ptr SWC::DB::Schemas::get ( cid_t  cid)
noexcept

Definition at line 56 of file Schemas.cc.

Referenced by SWC::Manager::MngdColumns::create(), SWC::Comm::Protocol::Mngr::Handler::get_schema(), SWC::Manager::MngdColumns::run_actions(), SWC::Manager::MngdColumns::update(), SWC::Manager::MngdColumns::update_status(), and SWC::Manager::MngdColumns::update_status_ack().

+ Here is the caller graph for this function:

◆ get() [2/2]

Schema::Ptr SWC::DB::Schemas::get ( const std::string &  name)
noexcept

Definition at line 66 of file Schemas.cc.

◆ matching()

void SWC::DB::Schemas::matching ( const SelectorPatterns patterns,
SchemasVec entries,
bool  no_sys = true 
)

Definition at line 94 of file Schemas.cc.

References SWC::DB::Schema::col_name, SWC::DB::Schemas::TagsPattern::comp, SWC::Condition::is_matching(), SWC::Condition::is_matching_extended(), m_mutex, SWC::DB::Schemas::SelectorPatterns::names, SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::resize(), SWC::Condition::SBS, SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC::Condition::SPS, SWC::DB::Types::SystemColumn::SYS_CID_END, SWC::DB::Schema::tags, and SWC::DB::Schemas::SelectorPatterns::tags.

Referenced by SWC::Comm::Protocol::Mngr::Handler::column_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

void SWC::DB::Schemas::remove ( cid_t  cid)

Definition at line 34 of file Schemas.cc.

References _remove(), and m_mutex.

Referenced by SWC::Manager::MngdColumns::remove(), and SWC::Manager::MngdColumns::update_status_ack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replace()

void SWC::DB::Schemas::replace ( const Schema::Ptr schema)

Definition at line 45 of file Schemas.cc.

References _replace(), and m_mutex.

Referenced by SWC::Manager::Schemas::store_load(), SWC::Manager::MngdColumns::update(), and SWC::Manager::MngdColumns::update_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

void SWC::DB::Schemas::reset ( )

Definition at line 305 of file Schemas.cc.

References m_mutex.

Referenced by SWC::Manager::MngdColumns::change_active(), SWC::Manager::MngdColumns::initialize(), and SWC::Manager::MngdColumns::reset().

+ Here is the caller graph for this function:

◆ size()

uint64_t SWC::DB::Schemas::size ( )

Definition at line 14 of file Schemas.cc.

References m_mutex, and size.

Referenced by SWC::Manager::Schemas::store_create().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_mutex

Core::MutexSptd SWC::DB::Schemas::m_mutex
protected

Definition at line 151 of file Schemas.h.

Referenced by add(), all(), matching(), remove(), replace(), reset(), and size().


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