feisty meow concerns codebase
2.140
|
Identifies requests made on an octopus by users. More...
#include <entity_defs.h>
Public Member Functions | |
octopus_request_id () | |
octopus_request_id (const octopus_entity &entity, int request_num) | |
bool | operator== (const octopus_request_id &that) const |
bool | blank () const |
returns true if this is a blank id (as constructed by default ctor). More... | |
int | packed_size () const |
reports how large the packed id will be. More... | |
basis::astring | mangled_form () const |
similar to entity id. More... | |
basis::astring | text_form () const |
human readable form of the request. More... | |
basis::astring | to_text () const |
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... | |
Static Public Member Functions | |
static octopus_request_id | randomized_id () |
provides a pre-randomized request id. More... | |
static octopus_request_id | from_text (const basis::astring &to_convert) |
Public Attributes | |
octopus_entity | _entity |
the entity. More... | |
int | _request_num |
the item number from the entity. More... | |
Identifies requests made on an octopus by users.
Uniquely identifies a request passed to an octopus server given that the number of requests from one entity can be contained within the range of signed integers. if the requests come fast enough for the request numbers to wrap around, and if the requests can remain outstanding for a really long time, it may be wise to create a new login.
Definition at line 113 of file entity_defs.h.
|
inline |
Definition at line 119 of file entity_defs.h.
Referenced by from_text(), and randomized_id().
|
inline |
Definition at line 121 of file entity_defs.h.
bool octopi::octopus_request_id::blank | ( | ) | const |
returns true if this is a blank id (as constructed by default ctor).
Definition at line 179 of file entity_defs.cpp.
References _entity, _request_num, and octopi::octopus_entity::blank().
|
static |
Definition at line 192 of file entity_defs.cpp.
References basis::astring::end(), basis::astring::find(), octopi::octopus_entity::from_text(), basis::negative(), octopus_request_id(), and basis::astring::substring().
astring octopi::octopus_request_id::mangled_form | ( | ) | const |
similar to entity id.
Definition at line 173 of file entity_defs.cpp.
References _entity, _request_num, and octopi::octopus_entity::mangled_form().
Referenced by octopi::identity_tentacle::consume(), cromp::cromp_common::pack_and_ship(), and to_text().
|
inline |
Definition at line 129 of file entity_defs.h.
References _entity, and _request_num.
|
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 202 of file entity_defs.cpp.
References _entity, _request_num, basis::attach(), and octopi::octopus_entity::pack().
Referenced by octopi::unhandled_request::pack().
|
virtual |
reports how large the packed id will be.
Implements basis::packable.
Definition at line 170 of file entity_defs.cpp.
References _entity, and octopi::octopus_entity::packed_size().
Referenced by octopi::unhandled_request::packed_size(), and cromp::cromp_transaction::unflatten().
|
static |
provides a pre-randomized request id.
this should only be used for the very first request made to an octopus, in order to obtain a valid identity.
Definition at line 182 of file entity_defs.cpp.
References mathematics::chaos::inclusive(), MAXINT32, and octopus_request_id().
astring octopi::octopus_request_id::text_form | ( | ) | const |
human readable form of the request.
Definition at line 176 of file entity_defs.cpp.
References _entity, _request_num, and octopi::octopus_entity::text_form().
Referenced by cromp::cromp_client::decrypt_package_as_needed(), cromp::cromp_client::login(), and octopi::unhandled_request::text_form().
|
inline |
Definition at line 143 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 208 of file entity_defs.cpp.
References _entity, _request_num, basis::detach(), and octopi::octopus_entity::unpack().
Referenced by cromp::cromp_transaction::unflatten(), and octopi::unhandled_request::unpack().
octopus_entity octopi::octopus_request_id::_entity |
the entity.
Definition at line 116 of file entity_defs.h.
Referenced by octopi::entity_data_bin::add_item(), blank(), octopi::encryption_tentacle::consume(), octopi::login_tentacle::consume(), create_request_id(), cromp::cromp_client::login(), mangled_form(), operator==(), pack(), packed_size(), text_form(), and unpack().
int octopi::octopus_request_id::_request_num |
the item number from the entity.
Definition at line 117 of file entity_defs.h.
Referenced by blank(), create_request_id(), mangled_form(), operator==(), pack(), text_form(), and unpack().