98 virtual clonable *
clone()
const = 0;
150 template <
class contents>
Provides a dynamically resizable ASCII character string.
Defines the base class for all string processing objects in hoople.
A very common template for a dynamic array of bytes.
A clonable object knows how to make copy of itself.
A base class for objects that can pack into an array of bytes.
A base class for objects that can provide a synopsis of their current state.
virtual const char * class_name() const =0
Returns the bare name of this class as a constant character pointer.
An infoton is an individual request parcel with accompanying information.
infoton & operator=(const infoton &to_copy)
assigns only the base class portion.
virtual void text_form(basis::base_string &state_fill) const =0
requires derived infotons to be able to show their state as a string.
virtual basis::astring text_form() const
local version just makes text_form() more functional.
virtual int packed_size() const =0
reports how large the infoton will be when packed.
static void fast_pack(basis::byte_array &packed_form, const infoton &to_pack)
flattens an infoton "to_pack" into the byte array "packed_form".
virtual bool unpack(basis::byte_array &packed_form)=0
restores an infoton from a packed form.
static int fast_pack_overhead(const structures::string_array &classifier)
reports how much space is needed to pack the "classifier".
bool check_classifier(const basis::astring &class_name, const basis::astring &caller)
checks that the classifier seems valid.
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.
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.
const structures::string_array & classifier() const
this array of strings is the "name" for this infoton.
DEFINE_CLASS_NAME("infoton")
infoton(const structures::string_array &classifier)
creates an infoton with the "classifier".
void set_classifier(const structures::string_array &new_classifier)
sets the infoton's classifier to the "new_classifier".
virtual clonable * clone() const =0
must be provided to allow creation of a copy of this object.
virtual void pack(basis::byte_array &packed_form) const =0
stuffs the data in the infoton into the "packed_form".
An array of strings with some additional helpful methods.
basis::clonable * cloner(const contents &this_obj)
a templated method for cloning any infoton with a valid copy constructor.