|
cluck 1.0.1
The cluster lock service.
|
#include <computer.h>
Public Types | |
| typedef std::map< std::string, pointer_t > | map_t |
| typedef std::shared_ptr< computer > | pointer_t |
| typedef std::int8_t | priority_t |
| typedef std::uint32_t | random_t |
| typedef std::vector< pointer_t > | vector_t |
Public Member Functions | |
| computer () | |
| computer (std::string const &name, priority_t priority, addr::addr ip_address) | |
| bool | get_connected () const |
| std::string const & | get_id () const |
| addr::addr const & | get_ip_address () const |
| std::string const & | get_name () const |
| priority_t | get_priority () const |
| snapdev::timespec_ex const & | get_start_time () const |
| bool | is_self () const |
| void | set_connected (bool connected) |
| bool | set_id (std::string const &id) |
Initialize this computer object from id. | |
| void | set_start_time (snapdev::timespec_ex const &start_time) |
Static Public Attributes | |
| static priority_t const | PRIORITY_DEFAULT = 14 |
| static priority_t const | PRIORITY_LEADER = 0 |
| static priority_t const | PRIORITY_MAX = 15 |
| static priority_t const | PRIORITY_MIN = 0 |
| static priority_t const | PRIORITY_OFF = 15 |
| static priority_t const | PRIORITY_UNDEFINED = -1 |
| static priority_t const | PRIORITY_USER_MIN = 1 |
Private Attributes | |
| bool | f_connected = true |
| std::string | f_id = std::string() |
| addr::addr | f_ip_address = addr::addr() |
| std::string | f_name = std::string() |
| pid_t | f_pid = 0 |
| priority_t | f_priority = PRIORITY_UNDEFINED |
| random_t | f_random_id = 0 |
| bool | f_self = false |
| snapdev::timespec_ex | f_start_time = snapdev::timespec_ex() |
Definition at line 44 of file computer.h.
| typedef std::map<std::string, pointer_t> cluck_daemon::computer::map_t |
Definition at line 50 of file computer.h.
| typedef std::shared_ptr<computer> cluck_daemon::computer::pointer_t |
Definition at line 49 of file computer.h.
| typedef std::int8_t cluck_daemon::computer::priority_t |
Definition at line 47 of file computer.h.
| typedef std::uint32_t cluck_daemon::computer::random_t |
Definition at line 48 of file computer.h.
| typedef std::vector<pointer_t> cluck_daemon::computer::vector_t |
Definition at line 51 of file computer.h.
| cluck_daemon::computer::computer | ( | ) |
Definition at line 76 of file computer.cpp.
| cluck_daemon::computer::computer | ( | std::string const & | name, |
| priority_t | priority, | ||
| addr::addr | ip_address | ||
| ) |
Definition at line 83 of file computer.cpp.
References f_name, f_priority, f_random_id, PRIORITY_MAX, and PRIORITY_USER_MIN.
| bool cluck_daemon::computer::get_connected | ( | ) | const |
Definition at line 131 of file computer.cpp.
References f_connected.
| std::string const & cluck_daemon::computer::get_id | ( | ) | const |
Definition at line 295 of file computer.cpp.
References f_id, f_ip_address, f_name, f_pid, f_priority, f_random_id, and PRIORITY_UNDEFINED.
| addr::addr const & cluck_daemon::computer::get_ip_address | ( | ) | const |
Definition at line 330 of file computer.cpp.
References f_ip_address.
| std::string const & cluck_daemon::computer::get_name | ( | ) | const |
Definition at line 289 of file computer.cpp.
References f_name.
Referenced by cluck_daemon::cluckd::msg_lock_started().
| computer::priority_t cluck_daemon::computer::get_priority | ( | ) | const |
Definition at line 271 of file computer.cpp.
References f_priority.
| snapdev::timespec_ex const & cluck_daemon::computer::get_start_time | ( | ) | const |
Definition at line 283 of file computer.cpp.
References f_start_time.
| bool cluck_daemon::computer::is_self | ( | ) | const |
Definition at line 119 of file computer.cpp.
References f_self.
| void cluck_daemon::computer::set_connected | ( | bool | connected | ) |
Definition at line 125 of file computer.cpp.
References f_connected.
Referenced by cluck_daemon::cluckd::msg_lock_started().
| bool cluck_daemon::computer::set_id | ( | std::string const & | id | ) |
| logic_error | If the function was already called once successfully, then this exception is raised when trying to do call it again. |
Definition at line 153 of file computer.cpp.
References f_id, f_ip_address, f_name, f_pid, f_priority, f_random_id, PRIORITY_MAX, PRIORITY_UNDEFINED, and PRIORITY_USER_MIN.
Referenced by cluck_daemon::cluckd::msg_lock_started().
| void cluck_daemon::computer::set_start_time | ( | snapdev::timespec_ex const & | start_time | ) |
Definition at line 277 of file computer.cpp.
References f_start_time.
Referenced by cluck_daemon::cluckd::msg_lock_started().
|
private |
Definition at line 83 of file computer.h.
Referenced by get_connected(), and set_connected().
|
mutableprivate |
Definition at line 81 of file computer.h.
|
private |
Definition at line 88 of file computer.h.
Referenced by get_id(), get_ip_address(), and set_id().
|
private |
Definition at line 90 of file computer.h.
Referenced by computer(), get_id(), get_name(), and set_id().
|
private |
Definition at line 89 of file computer.h.
|
private |
Definition at line 86 of file computer.h.
Referenced by computer(), get_id(), get_priority(), and set_id().
|
private |
Definition at line 87 of file computer.h.
Referenced by computer(), get_id(), and set_id().
|
private |
Definition at line 84 of file computer.h.
Referenced by is_self().
|
private |
Definition at line 92 of file computer.h.
Referenced by get_start_time(), and set_start_time().
|
static |
Definition at line 57 of file computer.h.
|
static |
Definition at line 55 of file computer.h.
|
static |
Definition at line 59 of file computer.h.
Referenced by computer(), cluck_daemon::cluckd::msg_cluster_up(), and set_id().
|
static |
Definition at line 54 of file computer.h.
|
static |
Definition at line 58 of file computer.h.
Referenced by cluck_daemon::cluckd::election_status(), and cluck_daemon::cluckd::msg_cluster_up().
|
static |
Definition at line 53 of file computer.h.
|
static |
Definition at line 56 of file computer.h.
Referenced by computer(), cluck_daemon::cluckd::msg_cluster_up(), and set_id().
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.