#include <swcdb/db/client/service/mngr/Groups.h>
Classes | |
struct | GroupHost |
Public Types | |
typedef std::shared_ptr< Groups > | Ptr |
typedef Core::Vector< Group::Ptr > | Vec |
Public Member Functions | |
Groups (const Config::Settings &settings) | |
Groups (const Groups &other, Groups::Vec &&) | |
Groups (const Groups &)=delete | |
Groups & | operator= (const Groups &)=delete |
~Groups () noexcept | |
Ptr | init () |
Ptr | copy () |
void | on_cfg_update () |
Vec | get_groups () |
void | hosts (uint8_t role, cid_t cid, Hosts &hosts, GroupHost &group_host) |
Vec | get_groups (const Comm::EndPoints &endpoints) |
Comm::EndPoints | get_endpoints (uint8_t role=0, cid_t cid_begin=0, cid_t cid_end=0) |
void | print (std::ostream &out) |
void | add (GroupHost &&g_host) |
void | remove (const Comm::EndPoints &endpoints) |
void | select (const cid_t &cid, Comm::EndPoints &endpoints) |
void | select (const uint8_t &role, Comm::EndPoints &endpoints) |
Private Attributes | |
Config::Property::Value_strings_g::Ptr | cfg_hosts |
const uint16_t | cfg_port |
Core::MutexSptd | m_mutex |
Core::Vector< GroupHost > | m_active_g_host |
Comm::Networks | m_nets |
Additional Inherited Members | |
Private Types inherited from SWC::Core::Vector< Group::Ptr > | |
using | value_type = Group::Ptr |
using | size_type = uint32_t |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
typedef value_type & | reference |
typedef const value_type & | const_reference |
Static Private Member Functions inherited from SWC::Core::Vector< Group::Ptr > | |
constexpr static SWC_CAN_INLINE size_type | max_size () noexcept |
typedef std::shared_ptr<Groups> SWC::client::Mngr::Groups::Ptr |
SWC::client::Mngr::Groups::Groups | ( | const Config::Settings & | settings | ) |
Definition at line 92 of file Groups.cc.
References SWC::Error::CONFIG_BAD_VALUE, SWC::Comm::Resolver::get_networks(), SWC::Config::Properties::get_strs(), m_nets, and SWC_THROWF.
Referenced by copy().
SWC::client::Mngr::Groups::Groups | ( | const Groups & | other, |
Groups::Vec && | groups | ||
) |
|
delete |
|
private |
Definition at line 214 of file Groups.cc.
References SWC::Core::Vector< Group::Ptr >::emplace_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Comm::Resolver::get_endpoints(), SWC::Comm::Resolver::is_ipv4_address(), SWC::Comm::Resolver::is_ipv6_address(), m_nets, and SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back().
Referenced by on_cfg_update().
void SWC::client::Mngr::Groups::add | ( | Groups::GroupHost && | g_host | ) |
Definition at line 311 of file Groups.cc.
References SWC::Comm::has_endpoint(), m_active_g_host, and m_mutex.
Groups::Ptr SWC::client::Mngr::Groups::copy | ( | ) |
Definition at line 122 of file Groups.cc.
References Groups(), m_mutex, SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), and SWC::Core::Vector< Group::Ptr >::size().
Comm::EndPoints SWC::client::Mngr::Groups::get_endpoints | ( | uint8_t | role = 0 , |
cid_t | cid_begin = 0 , |
||
cid_t | cid_end = 0 |
||
) |
Groups::Vec SWC::client::Mngr::Groups::get_groups | ( | ) |
Definition at line 248 of file Groups.cc.
References SWC::Core::Vector< Group::Ptr >::cbegin(), SWC::Core::Vector< Group::Ptr >::cend(), and m_mutex.
Groups::Vec SWC::client::Mngr::Groups::get_groups | ( | const Comm::EndPoints & | endpoints | ) |
Definition at line 271 of file Groups.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::cbegin(), SWC::Core::Vector< T, SizeT, GROW_SZ >::cend(), m_mutex, and SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back().
void SWC::client::Mngr::Groups::hosts | ( | uint8_t | role, |
cid_t | cid, | ||
Hosts & | hosts, | ||
Groups::GroupHost & | group_host | ||
) |
Definition at line 253 of file Groups.cc.
References SWC::client::Mngr::Groups::GroupHost::cid_begin, SWC::client::Mngr::Groups::GroupHost::cid_end, SWC::DB::Types::MngrRole::COLUMNS, m_mutex, and SWC::client::Mngr::Groups::GroupHost::role.
Referenced by on_cfg_update().
Groups::Ptr SWC::client::Mngr::Groups::init | ( | ) |
Definition at line 115 of file Groups.cc.
References cfg_hosts, on_cfg_update(), and SWC::Config::Property::Value_strings_g::set_cb_on_chg().
void SWC::client::Mngr::Groups::on_cfg_update | ( | ) |
Definition at line 131 of file Groups.cc.
References _add_host(), SWC::DB::Types::MngrRole::ALL, cfg_hosts, cfg_port, SWC::Core::Vector< Group::Ptr >::clear(), SWC::DB::Types::MngrRole::COLUMNS, SWC::Config::Property::from_string(), SWC::Config::Property::Value_strings_g::get(), hosts(), SWC::Core::MutexSptd::lock(), SWC::LOG_DEBUG, m_mutex, SWC::DB::Types::MngrRole::NO_COLUMNS, print(), SWC::DB::Types::MngrRole::RANGERS, SWC::DB::Types::MngrRole::SCHEMAS, SWC::Condition::str_case_eq(), SWC_LOG, SWC_LOG_OSTREAM, SWC_LOG_OUT, SWC_LOGF, and SWC::Core::MutexSptd::unlock().
Referenced by init().
void SWC::client::Mngr::Groups::print | ( | std::ostream & | out | ) |
Definition at line 303 of file Groups.cc.
References m_mutex.
Referenced by on_cfg_update().
void SWC::client::Mngr::Groups::remove | ( | const Comm::EndPoints & | endpoints | ) |
Definition at line 327 of file Groups.cc.
References SWC::Comm::has_endpoint(), m_active_g_host, and m_mutex.
void SWC::client::Mngr::Groups::select | ( | const cid_t & | cid, |
Comm::EndPoints & | endpoints | ||
) |
Definition at line 338 of file Groups.cc.
References SWC::DB::Types::MngrRole::COLUMNS, m_active_g_host, and m_mutex.
void SWC::client::Mngr::Groups::select | ( | const uint8_t & | role, |
Comm::EndPoints & | endpoints | ||
) |
Definition at line 351 of file Groups.cc.
References m_active_g_host, and m_mutex.
|
private |
Definition at line 121 of file Groups.h.
Referenced by init(), and on_cfg_update().
|
private |
Definition at line 122 of file Groups.h.
Referenced by on_cfg_update().
|
private |
|
private |
Definition at line 124 of file Groups.h.
Referenced by add(), copy(), get_endpoints(), get_groups(), hosts(), on_cfg_update(), print(), remove(), and select().
|
private |
Definition at line 126 of file Groups.h.
Referenced by _add_host(), and Groups().