feisty meow concerns codebase  2.140
octopi::security_infoton Class Reference

Encapsulates security activities (login, logout, refresh). More...

#include <security_infoton.h>

Inheritance diagram for octopi::security_infoton:
Collaboration diagram for octopi::security_infoton:

Public Types

enum  login_modes { LI_LOGIN , LI_LOGOUT , LI_REFRESH }
 

Public Member Functions

 security_infoton ()
 
 security_infoton (login_modes mode, const basis::outcome &success, const basis::byte_array &verification)
 
 security_infoton (const security_infoton &to_copy)
 
virtual ~security_infoton ()
 
 DEFINE_CLASS_NAME ("security_infoton")
 
security_infotonoperator= (const security_infoton &to_copy)
 
const basis::byte_arrayverification () const
 
basis::byte_arrayverification ()
 
virtual void pack (basis::byte_array &packed_form) const
 stuffs the data in the infoton into the "packed_form". More...
 
virtual bool unpack (basis::byte_array &packed_form)
 restores an infoton from a packed form. More...
 
virtual clonableclone () const
 must be provided to allow creation of a copy of this object. More...
 
virtual int packed_size () const
 reports how large the infoton will be when packed. More...
 
virtual void text_form (basis::base_string &fill) const
 requires derived infotons to be able to show their state as a string. More...
 
- Public Member Functions inherited from octopi::infoton
 infoton (const structures::string_array &classifier)
 creates an infoton with the "classifier". More...
 
 infoton (const basis::astring &class_1)
 
 infoton (const basis::astring &class_1, const basis::astring &class_2)
 
 infoton (const basis::astring &class_1, const basis::astring &class_2, const basis::astring &cl_3)
 
 infoton (const infoton &to_copy)
 copies only the base class portion of the infoton. More...
 
virtual ~infoton ()
 
 DEFINE_CLASS_NAME ("infoton")
 
infotonoperator= (const infoton &to_copy)
 assigns only the base class portion. More...
 
const structures::string_arrayclassifier () const
 this array of strings is the "name" for this infoton. More...
 
void set_classifier (const structures::string_array &new_classifier)
 sets the infoton's classifier to the "new_classifier". More...
 
void set_classifier (const basis::astring &class_1)
 
void set_classifier (const basis::astring &class_1, const basis::astring &class_2)
 
void set_classifier (const basis::astring &class_1, const basis::astring &class_2, const basis::astring &cl_3)
 
bool check_classifier (const basis::astring &class_name, const basis::astring &caller)
 checks that the classifier seems valid. More...
 
virtual basis::astring text_form () const
 local version just makes text_form() more functional. 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 const structures::string_arraysecurity_classifier ()
 returns the classifier for this type of infoton. More...
 
- Static Public Member Functions inherited from octopi::infoton
static void fast_pack (basis::byte_array &packed_form, const infoton &to_pack)
 flattens an infoton "to_pack" into the byte array "packed_form". More...
 
static bool fast_unpack (basis::byte_array &packed_form, structures::string_array &classifier, basis::byte_array &info)
 undoes a previous fast_pack to restore the previous information. More...
 
static bool test_fast_unpack (const basis::byte_array &packed_form, int &packed_length)
 checks that the "packed_form" could hold a valid packed infoton. More...
 
static int fast_pack_overhead (const structures::string_array &classifier)
 reports how much space is needed to pack the "classifier". More...
 

Public Attributes

login_modes _mode
 what kind of request is being made here? More...
 
basis::outcome _success
 did the request succeed? More...
 

Detailed Description

Encapsulates security activities (login, logout, refresh).

Definition at line 24 of file security_infoton.h.

Member Enumeration Documentation

◆ login_modes

Enumerator
LI_LOGIN 

the requester wants to log in as a new entity.

LI_LOGOUT 

the requester surrenders its login.

LI_REFRESH 

the requester is still alive and wants to keep its login.

Definition at line 27 of file security_infoton.h.

Constructor & Destructor Documentation

◆ security_infoton() [1/3]

octopi::security_infoton::security_infoton ( )

Definition at line 30 of file security_infoton.cpp.

◆ security_infoton() [2/3]

octopi::security_infoton::security_infoton ( login_modes  mode,
const basis::outcome success,
const basis::byte_array verification 
)

Definition at line 37 of file security_infoton.cpp.

◆ security_infoton() [3/3]

octopi::security_infoton::security_infoton ( const security_infoton to_copy)

Definition at line 45 of file security_infoton.cpp.

◆ ~security_infoton()

octopi::security_infoton::~security_infoton ( )
virtual

Definition at line 54 of file security_infoton.cpp.

References basis::WHACK().

Member Function Documentation

◆ clone()

clonable * octopi::security_infoton::clone ( ) const
virtual

must be provided to allow creation of a copy of this object.

Implements octopi::infoton.

Definition at line 57 of file security_infoton.cpp.

Referenced by octopi::login_tentacle::consume().

◆ DEFINE_CLASS_NAME()

octopi::security_infoton::DEFINE_CLASS_NAME ( "security_infoton"  )

◆ operator=()

security_infoton & octopi::security_infoton::operator= ( const security_infoton to_copy)

◆ pack()

virtual void octopi::security_infoton::pack ( basis::byte_array packed_form) const
virtual

stuffs the data in the infoton into the "packed_form".

the derived method must know how to pack this particular type of infoton.

Implements octopi::infoton.

◆ packed_size()

virtual int octopi::security_infoton::packed_size ( ) const
virtual

reports how large the infoton will be when packed.

must be overridden by derived classes to provide a guess at how large the packed size of this will be. this is important to estimate accurately.

Implements octopi::infoton.

◆ security_classifier()

static const structures::string_array& octopi::security_infoton::security_classifier ( )
static

returns the classifier for this type of infoton.

Referenced by octopi::login_tentacle::reconstitute().

◆ text_form()

virtual void octopi::security_infoton::text_form ( basis::base_string state_fill) const
inlinevirtual

requires derived infotons to be able to show their state as a string.

Implements octopi::infoton.

Definition at line 61 of file security_infoton.h.

References _mode, _success, basis::base_string::assign(), basis::text_formable::class_name(), and basis::outcome::value().

◆ unpack()

virtual bool octopi::security_infoton::unpack ( basis::byte_array packed_form)
virtual

restores an infoton from a packed form.

the unpack() method will be utilized by tentacles that support this type of object.

Implements octopi::infoton.

◆ verification() [1/2]

byte_array & octopi::security_infoton::verification ( )

Definition at line 73 of file security_infoton.cpp.

◆ verification() [2/2]

const byte_array & octopi::security_infoton::verification ( ) const

Definition at line 70 of file security_infoton.cpp.

Referenced by octopi::login_tentacle::consume().

Member Data Documentation

◆ _mode

login_modes octopi::security_infoton::_mode

what kind of request is being made here?

Definition at line 33 of file security_infoton.h.

Referenced by octopi::login_tentacle::consume(), operator=(), octopi::SAFE_STATIC_CONST(), and text_form().

◆ _success

basis::outcome octopi::security_infoton::_success

did the request succeed?

Definition at line 34 of file security_infoton.h.

Referenced by octopi::login_tentacle::consume(), operator=(), and text_form().


The documentation for this class was generated from the following files: