octopus_entity Class Reference

Provides a way of identifying users of an octopus object. More...

#include <entity_defs.h>

Inheritance diagram for octopus_entity:

Inheritance graph
[legend]
Collaboration diagram for octopus_entity:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 octopus_entity ()
 blank constructor.
 octopus_entity (const istring &hostname, int process_id, int sequencer, int add_in)
 constructor taking all the available parameters for an entity.
 octopus_entity (const octopus_entity &to_copy)
 ~octopus_entity ()
octopus_entityoperator= (const octopus_entity &to_copy)
bool blank () const
 true if the entity is blank, as constructed by default constructor.
bool operator== (const octopus_entity &that) const
bool operator!= (const octopus_entity &that) const
istring hostname () const
 returns the hostname portion of the id.
int process_id () const
 returns the process number in the id.
int sequencer () const
 returns the sequencing number from the id.
int add_in () const
 returns the random add-in from the id.
void hostname (const istring &new_host)
 set the host.
void process_id (int id)
 set the process id.
void sequencer (int seq)
 set the sequencer value.
void add_in (int add)
 set the add-in value.
istring mangled_form () const
 returns the combined string form of the identifier.
istring text_form () const
 returns a readable form of the identifier.
istring to_text () const
 conversion to text format for display.
int packed_size () const
 reports how large the packed entity will be.
virtual void pack (byte_array &packed_form) const
 Creates a packed form of the packable object in "packed_form".
virtual bool unpack (byte_array &packed_form)
 Restores the packable from the "packed_form".

Static Public Member Functions

static octopus_entity from_text (const istring &to_convert)
 conversion from text format, parsing parameters out.
static void breakout (const istring &mangled_form, istring &hostname, int &process_id, int &sequencer, int &add_in)
 takes a "mangled_form" of an entity id and retrieves the components.

Detailed Description

Provides a way of identifying users of an octopus object.

NOTE: this is a heavy-weight header intended for forward declaration.

Definition at line 33 of file entity_defs.h.


Constructor & Destructor Documentation

octopus_entity::octopus_entity (  ) 

blank constructor.

Definition at line 32 of file entity_defs.cpp.

Referenced by from_text().

octopus_entity::octopus_entity ( const istring 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 39 of file entity_defs.cpp.

octopus_entity::octopus_entity ( const octopus_entity to_copy  ) 

Definition at line 47 of file entity_defs.cpp.

References operator=().

octopus_entity::~octopus_entity (  ) 

Definition at line 52 of file entity_defs.cpp.

References WHACK().


Member Function Documentation

octopus_entity & octopus_entity::operator= ( const octopus_entity to_copy  ) 

Definition at line 69 of file entity_defs.cpp.

References _add_in, _hostname, _pid, and _sequencer.

Referenced by octopus_entity().

bool octopus_entity::blank (  )  const

true if the entity is blank, as constructed by default constructor.

Definition at line 96 of file entity_defs.cpp.

References istring::empty().

Referenced by octopus_request_id::blank().

bool octopus_entity::operator== ( const octopus_entity that  )  const

Definition at line 140 of file entity_defs.cpp.

References _add_in, _hostname, _pid, and _sequencer.

bool octopus_entity::operator!= ( const octopus_entity that  )  const [inline]

Definition at line 56 of file entity_defs.h.

istring octopus_entity::hostname (  )  const

returns the hostname portion of the id.

Definition at line 79 of file entity_defs.cpp.

Referenced by breakout().

int octopus_entity::process_id (  )  const

returns the process number in the id.

Definition at line 81 of file entity_defs.cpp.

Referenced by from_text().

int octopus_entity::sequencer (  )  const

returns the sequencing number from the id.

Definition at line 83 of file entity_defs.cpp.

Referenced by from_text().

int octopus_entity::add_in (  )  const

returns the random add-in from the id.

Definition at line 85 of file entity_defs.cpp.

Referenced by from_text().

void octopus_entity::hostname ( const istring new_host  ) 

set the host.

Definition at line 93 of file entity_defs.cpp.

void octopus_entity::process_id ( int  id  ) 

set the process id.

Definition at line 87 of file entity_defs.cpp.

void octopus_entity::sequencer ( int  seq  ) 

set the sequencer value.

Definition at line 89 of file entity_defs.cpp.

void octopus_entity::add_in ( int  add  ) 

set the add-in value.

Definition at line 91 of file entity_defs.cpp.

istring octopus_entity::mangled_form (  )  const

returns the combined string form of the identifier.

Definition at line 118 of file entity_defs.cpp.

References byte_format::bytes_to_string(), istring::length(), istring::observe(), and istring::s().

Referenced by entity_data_bin::acquire_for_entity(), key_repository::add(), simple_entity_registry::add_entity(), cromp_security::add_entity(), any_item_applier(), simple_entity_registry::authorized(), breakout(), encryption_tentacle::consume(), identity_tentacle::consume(), cromp_client::cromp_client(), octopus::expunge(), simple_entity_registry::locate_entity(), key_repository::lock(), octopus_request_id::mangled_form(), simple_entity_registry::refresh_entity(), cromp_client::reset(), key_repository::whack(), and simple_entity_registry::zap_entity().

istring octopus_entity::text_form (  )  const

returns a readable form of the identifier.

Definition at line 105 of file entity_defs.cpp.

References parser_bits::is_printable_ascii(), istring::length(), REPLACEMENT_CHARACTER, and istring::s().

Referenced by key_repository::add(), key_repository::lock(), cromp_client::login(), octopus_request_id::text_form(), key_repository::whack(), and cromp_server::wrap_infoton().

istring octopus_entity::to_text (  )  const [inline]

conversion to text format for display.

Definition at line 75 of file entity_defs.h.

octopus_entity octopus_entity::from_text ( const istring to_convert  )  [static]

conversion from text format, parsing parameters out.

Definition at line 54 of file entity_defs.cpp.

References add_in(), breakout(), array< contents >::observe(), octopus_entity(), process_id(), sequencer(), and byte_format::string_to_bytes().

Referenced by octopus_request_id::from_text().

void octopus_entity::breakout ( const istring mangled_form,
istring hostname,
int &  process_id,
int &  sequencer,
int &  add_in 
) [static]

takes a "mangled_form" of an entity id and retrieves the components.

Definition at line 126 of file entity_defs.cpp.

References istring::find(), hostname(), mangled_form(), istring::s(), and istring::zap().

Referenced by from_text().

int octopus_entity::packed_size (  )  const [virtual]

reports how large the packed entity will be.

Reimplemented from packable.

Definition at line 99 of file entity_defs.cpp.

References istring::length().

Referenced by octopus_request_id::packed_size().

void octopus_entity::pack ( byte_array packed_form  )  const [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 packable.

Definition at line 148 of file entity_defs.cpp.

References basis::attach(), and istring::pack().

Referenced by identity_infoton::pack(), and octopus_request_id::pack().

bool octopus_entity::unpack ( byte_array packed_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 packable.

Definition at line 156 of file entity_defs.cpp.

References basis::detach(), and istring::unpack().

Referenced by identity_infoton::unpack(), and octopus_request_id::unpack().


The documentation for this class was generated from the following files:
Generated on Tue Aug 19 05:12:32 2008 for HOOPLE Libraries by  doxygen 1.5.1