feisty meow concerns codebase  2.140
octopi::unhandled_request Class Reference

Informs the caller that a request type was unknown to the server octopus. More...

#include <unhandled_request.h>

Inheritance diagram for octopi::unhandled_request:
Collaboration diagram for octopi::unhandled_request:

Public Member Functions

 unhandled_request (const octopus_request_id &id=octopus_request_id(), const structures::string_array &original_classifier=structures::string_array(), const basis::outcome &reason=basis::common::NO_HANDLER)
 
 DEFINE_CLASS_NAME ("unhandled_request")
 
virtual void text_form (basis::base_string &fill) const
 requires derived infotons to be able to show their state as a string. More...
 
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...
 
- 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 structures::string_array the_classifier ()
 the classifier for unknown infotons makes unhandled requests unique. 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

octopus_request_id _original_id
 the failed request's identifier. More...
 
structures::string_array _original_classifier
 the original name of the request. More...
 
basis::outcome _reason
 the reason why this request was provided. More...
 

Detailed Description

Informs the caller that a request type was unknown to the server octopus.

The accompanying octopus_request_id specifies the particular request that failed. The classifier of the original request is also included for reference. This allows the client to get an immediate response from the server when we have no idea what they are asking for, rather than the client needing to timeout on the failed request. Note: this is a heavy-weight header that should not be included in other headers.

Definition at line 39 of file unhandled_request.h.

Constructor & Destructor Documentation

◆ unhandled_request()

octopi::unhandled_request::unhandled_request ( const octopus_request_id id = octopus_request_id(),
const structures::string_array original_classifier = structures::string_array(),
const basis::outcome reason = basis::common::NO_HANDLER 
)

Definition at line 22 of file unhandled_request.cpp.

Referenced by clone().

Member Function Documentation

◆ clone()

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

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

Implements octopi::infoton.

Definition at line 30 of file unhandled_request.cpp.

References _original_classifier, _original_id, _reason, and unhandled_request().

◆ DEFINE_CLASS_NAME()

octopi::unhandled_request::DEFINE_CLASS_NAME ( "unhandled_request"  )

◆ pack()

void octopi::unhandled_request::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.

Definition at line 51 of file unhandled_request.cpp.

References _original_classifier, _original_id, _reason, basis::attach(), structures::string_array::pack(), octopi::octopus_request_id::pack(), and basis::outcome::value().

◆ packed_size()

int octopi::unhandled_request::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.

Definition at line 33 of file unhandled_request.cpp.

References _original_classifier, _original_id, _reason, basis::outcome::packed_size(), structures::string_array::packed_size(), and octopi::octopus_request_id::packed_size().

◆ text_form()

void octopi::unhandled_request::text_form ( basis::base_string state_fill) const
virtual

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

Implements octopi::infoton.

Definition at line 39 of file unhandled_request.cpp.

References _original_id, _reason, basis::base_string::assign(), octopi::octopus_request_id::text_form(), octopi::infoton::text_form(), the_classifier(), and basis::outcome::value().

◆ the_classifier()

string_array octopi::unhandled_request::the_classifier ( )
static

the classifier for unknown infotons makes unhandled requests unique.

Unhandled is now a reserved word for classifiers. That's the classifier for all unhandled_request objects as returned by the_classifier().

Definition at line 48 of file unhandled_request.cpp.

References octopi::initter, and string_array().

Referenced by text_form().

◆ unpack()

bool octopi::unhandled_request::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.

Definition at line 58 of file unhandled_request.cpp.

References _original_classifier, _original_id, _reason, basis::detach(), structures::string_array::unpack(), and octopi::octopus_request_id::unpack().

Member Data Documentation

◆ _original_classifier

structures::string_array octopi::unhandled_request::_original_classifier

the original name of the request.

Definition at line 44 of file unhandled_request.h.

Referenced by clone(), pack(), packed_size(), and unpack().

◆ _original_id

octopus_request_id octopi::unhandled_request::_original_id

the failed request's identifier.

Definition at line 43 of file unhandled_request.h.

Referenced by clone(), pack(), packed_size(), text_form(), and unpack().

◆ _reason

basis::outcome octopi::unhandled_request::_reason

the reason why this request was provided.

Definition at line 45 of file unhandled_request.h.

Referenced by cromp::cromp_client::acquire(), cromp::cromp_client::acquire_any(), clone(), cromp::cromp_client::login(), pack(), packed_size(), text_form(), and unpack().


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