24 using namespace basis;
30 security_infoton::security_infoton()
31 :
infoton(security_classifier()),
39 :
infoton(security_classifier()),
49 _success(to_copy._success),
50 _verification(new
byte_array(*to_copy._verification))
55 {
WHACK(_verification); }
58 {
return cloner<security_infoton>(*
this); }
62 if (
this == &to_copy)
return *
this;
66 *_verification = *to_copy._verification;
71 {
return *_verification; }
84 + _verification->
length() +
sizeof(int);
100 if (!
detach(packed_form, value))
return false;
int length() const
Returns the current reported length of the allocated C array.
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
A clonable object knows how to make copy of itself.
Outcomes describe the state of completion for an operation.
An infoton is an individual request parcel with accompanying information.
const structures::string_array & classifier() const
this array of strings is the "name" for this infoton.
void set_classifier(const structures::string_array &new_classifier)
sets the infoton's classifier to the "new_classifier".
Encapsulates security activities (login, logout, refresh).
basis::outcome _success
did the request succeed?
virtual void pack(basis::byte_array &packed_form) const
stuffs the data in the infoton into the "packed_form".
virtual int packed_size() const
reports how large the infoton will be when packed.
const basis::byte_array & verification() const
virtual clonable * clone() const
must be provided to allow creation of a copy of this object.
virtual ~security_infoton()
login_modes _mode
what kind of request is being made here?
virtual bool unpack(basis::byte_array &packed_form)
restores an infoton from a packed form.
static const structures::string_array & security_classifier()
returns the classifier for this type of infoton.
security_infoton & operator=(const security_infoton &to_copy)
Manages a service within an octopus by processing certain infotons.
An array of strings with some additional helpful methods.
The guards collection helps in testing preconditions and reporting errors.
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
void attach(byte_array &packed_form, const char *to_attach)
Packs a character string "to_attach" into "packed_form".
bool detach(byte_array &packed_form, astring &to_detach)
Unpacks a character string "to_attach" from "packed_form".
const astring login_classifier[]
SAFE_STATIC_CONST(string_array, identity_infoton::identity_classifier,(1, identity_classifier_strings)) int identity_infoton
A dynamic container class that holds any kind of object via pointers.
void attach(byte_array &packed_form, const byte_array &to_attach)
Packs a byte_array "to_attach" into "packed_form".
bool detach(byte_array &packed_form, byte_array &to_detach)
Unpacks a byte_array "to_detach" from "packed_form".