feisty meow concerns codebase
2.140
|
Provides a way of identifying users of an octopus object. More...
#include <entity_defs.h>
Public Member Functions | |
octopus_entity () | |
blank constructor. More... | |
octopus_entity (const basis::astring &hostname, int process_id, int sequencer, int add_in) | |
constructor taking all the available parameters for an entity. More... | |
octopus_entity (const octopus_entity &to_copy) | |
~octopus_entity () | |
octopus_entity & | operator= (const octopus_entity &to_copy) |
DEFINE_CLASS_NAME ("octopus_entity") | |
bool | blank () const |
true if the entity is blank, as constructed by default constructor. More... | |
bool | operator== (const octopus_entity &that) const |
const basis::astring & | hostname () const |
returns the hostname portion of the id. More... | |
int | process_id () const |
returns the process number in the id. More... | |
int | sequencer () const |
returns the sequencing number from the id. More... | |
int | add_in () const |
returns the random add-in from the id. More... | |
void | hostname (const basis::astring &new_host) |
set the host. More... | |
void | process_id (int id) |
set the process id. More... | |
void | sequencer (int seq) |
set the sequencer value. More... | |
void | add_in (int add) |
set the add-in value. More... | |
basis::astring | mangled_form () const |
returns the combined string form of the identifier. More... | |
basis::astring | text_form () const |
returns a readable form of the identifier. More... | |
virtual void | text_form (basis::base_string &to_fill) const |
Provides a text view of all the important info owned by this object. More... | |
basis::astring | to_text () const |
conversion to text format for display. More... | |
int | packed_size () const |
reports how large the packed entity will be. More... | |
virtual void | pack (basis::byte_array &packed_form) const |
Creates a packed form of the packable object in "packed_form". More... | |
virtual bool | unpack (basis::byte_array &packed_form) |
Restores the packable from the "packed_form". More... | |
Public Member Functions inherited from basis::text_formable | |
virtual const char * | class_name () const =0 |
Returns the bare name of this class as a constant character pointer. More... | |
Static Public Member Functions | |
static octopus_entity | from_text (const basis::astring &to_convert) |
conversion from text format, parsing parameters out. More... | |
static void | breakout (const basis::astring &mangled_form, basis::astring &hostname, int &process_id, int &sequencer, int &add_in) |
takes a "mangled_form" of an entity id and retrieves the components. More... | |
Provides a way of identifying users of an octopus object.
NOTE: this is a heavy-weight header intended for forward declaration.
Definition at line 34 of file entity_defs.h.
octopi::octopus_entity::octopus_entity | ( | ) |
octopi::octopus_entity::octopus_entity | ( | const basis::astring & | hostname, |
int | process_id, | ||
int | sequencer, | ||
int | add_in | ||
) |
constructor taking all the available parameters for an entity.
produces an id in the proper format given all the components. note that the hostname must be some fully qualified name for the host, such that it is as unique as you want names within the system to be.
Definition at line 42 of file entity_defs.cpp.
octopi::octopus_entity::octopus_entity | ( | const octopus_entity & | to_copy | ) |
Definition at line 50 of file entity_defs.cpp.
References operator=().
octopi::octopus_entity::~octopus_entity | ( | ) |
Definition at line 55 of file entity_defs.cpp.
References basis::WHACK().
int octopi::octopus_entity::add_in | ( | ) | const |
returns the random add-in from the id.
Definition at line 88 of file entity_defs.cpp.
Referenced by breakout(), and from_text().
void octopi::octopus_entity::add_in | ( | int | add | ) |
set the add-in value.
Definition at line 94 of file entity_defs.cpp.
bool octopi::octopus_entity::blank | ( | ) | const |
true if the entity is blank, as constructed by default constructor.
Definition at line 99 of file entity_defs.cpp.
References basis::astring::empty().
Referenced by octopi::octopus_request_id::blank().
|
static |
takes a "mangled_form" of an entity id and retrieves the components.
Definition at line 129 of file entity_defs.cpp.
References add_in(), basis::astring::find(), hostname(), mangled_form(), process_id(), basis::astring::s(), sequencer(), and basis::astring::zap().
Referenced by from_text().
octopi::octopus_entity::DEFINE_CLASS_NAME | ( | "octopus_entity" | ) |
|
static |
conversion from text format, parsing parameters out.
Definition at line 57 of file entity_defs.cpp.
References add_in(), breakout(), basis::array< contents >::observe(), octopus_entity(), process_id(), and sequencer().
Referenced by octopi::octopus_request_id::from_text().
const astring & octopi::octopus_entity::hostname | ( | ) | const |
returns the hostname portion of the id.
Definition at line 82 of file entity_defs.cpp.
Referenced by breakout().
void octopi::octopus_entity::hostname | ( | const basis::astring & | new_host | ) |
set the host.
Definition at line 96 of file entity_defs.cpp.
astring octopi::octopus_entity::mangled_form | ( | ) | const |
returns the combined string form of the identifier.
Definition at line 121 of file entity_defs.cpp.
References basis::astring::length(), basis::astring::observe(), and basis::astring::s().
Referenced by octopi::entity_data_bin::acquire_for_entity(), octopi::key_repository::add(), cromp::cromp_security::add_entity(), octopi::simple_entity_registry::add_entity(), octopi::simple_entity_registry::authorized(), breakout(), octopi::identity_tentacle::consume(), octopi::encryption_tentacle::consume(), cromp::cromp_client::cromp_client(), octopi::octopus::expunge(), octopi::simple_entity_registry::locate_entity(), octopi::key_repository::lock(), octopi::octopus_request_id::mangled_form(), octopi::simple_entity_registry::refresh_entity(), cromp::cromp_client::reset(), to_text(), octopi::key_repository::whack(), and octopi::simple_entity_registry::zap_entity().
octopus_entity & octopi::octopus_entity::operator= | ( | const octopus_entity & | to_copy | ) |
Definition at line 72 of file entity_defs.cpp.
Referenced by octopus_entity().
bool octopi::octopus_entity::operator== | ( | const octopus_entity & | that | ) | const |
Definition at line 143 of file entity_defs.cpp.
|
virtual |
Creates a packed form of the packable object in "packed_form".
This must append to the data in "packed_form" rather than clearing prior contents.
Implements basis::packable.
Definition at line 151 of file entity_defs.cpp.
References basis::attach(), and basis::astring::pack().
Referenced by octopi::octopus_request_id::pack().
|
virtual |
reports how large the packed entity will be.
Implements basis::packable.
Definition at line 102 of file entity_defs.cpp.
References basis::astring::length().
Referenced by octopi::octopus_request_id::packed_size(), and octopi::SAFE_STATIC_CONST().
int octopi::octopus_entity::process_id | ( | ) | const |
returns the process number in the id.
Definition at line 84 of file entity_defs.cpp.
Referenced by breakout(), and from_text().
void octopi::octopus_entity::process_id | ( | int | id | ) |
set the process id.
Definition at line 90 of file entity_defs.cpp.
int octopi::octopus_entity::sequencer | ( | ) | const |
returns the sequencing number from the id.
Definition at line 86 of file entity_defs.cpp.
Referenced by breakout(), and from_text().
void octopi::octopus_entity::sequencer | ( | int | seq | ) |
set the sequencer value.
Definition at line 92 of file entity_defs.cpp.
astring octopi::octopus_entity::text_form | ( | ) | const |
returns a readable form of the identifier.
Definition at line 108 of file entity_defs.cpp.
References basis::astring::length(), REPLACEMENT_CHARACTER, and basis::astring::s().
Referenced by octopi::key_repository::add(), cromp::cromp_client::instance_name(), octopi::key_repository::lock(), cromp::cromp_client::login(), octopi::octopus_request_id::text_form(), octopi::identity_infoton::text_form(), text_form(), octopi::key_repository::whack(), and cromp::cromp_server::wrap_infoton().
|
inlinevirtual |
Provides a text view of all the important info owned by this object.
It is understood that there could be a large amount of information and that this function might take a relatively long time to complete.
Implements basis::text_formable.
Definition at line 76 of file entity_defs.h.
References basis::base_string::assign(), and text_form().
|
inline |
conversion to text format for display.
Definition at line 80 of file entity_defs.h.
References mangled_form().
|
virtual |
Restores the packable from the "packed_form".
This object becomes the unpacked form, and therefore must lose any of its prior contents that depend on the data in "packed_form". This is up to the derived unpack function to figure out. The "packed_form" is modified by extracting all of the pieces that are used for this object; the remainder stays in "packed_form". true is returned if the unpacking was successful.
Implements basis::packable.
Definition at line 159 of file entity_defs.cpp.
References basis::detach(), and basis::astring::unpack().
Referenced by octopi::octopus_request_id::unpack().