feisty meow concerns codebase
2.140
|
A base class for objects that can pack into an array of bytes. More...
#include <byte_array.h>
Public Member Functions | |
virtual void | pack (byte_array &packed_form) const =0 |
Creates a packed form of the packable object in "packed_form". More... | |
virtual bool | unpack (byte_array &packed_form)=0 |
Restores the packable from the "packed_form". More... | |
virtual int | packed_size () const =0 |
Estimates the space needed for the packed structure. More... | |
A base class for objects that can pack into an array of bytes.
A packable is an abstract object that represents any object that can be transformed from a potentially deep form into an equivalent flat form. The flat form is a simple extent of memory stored as bytes.
Definition at line 86 of file byte_array.h.
|
pure 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.
Implemented in structures::version, synchronic::synchronizable, octopi::infoton, octopi::security_infoton, octopi::file_transfer_infoton, octopi::encryption_wrapper, octopi::encryption_infoton, sockets::machine_uid, sockets::internet_address, octopi::unhandled_request, octopi::identity_infoton, octopi::octopus_request_id, octopi::octopus_entity, timely::time_locus, timely::day_in_year, timely::clock_time, structures::string_table, structures::string_array, structures::string_set, filesystem::file_transfer_header, filesystem::filename_tree, filesystem::filename_list, filesystem::filename, filesystem::file_info, filesystem::directory_tree, geometric::rectangle< numeric_type >, geometric::rectangle< double >, geometric::rectangle< int >, geometric::point< numeric_type >, geometric::point< double >, geometric::point< int >, geometric::angle< contents >, and geometric::angle< double >.
|
pure virtual |
Estimates the space needed for the packed structure.
Implemented in synchronic::synchronizable, octopi::infoton, octopi::security_infoton, octopi::file_transfer_infoton, octopi::encryption_wrapper, octopi::encryption_infoton, sockets::machine_uid, sockets::internet_address, octopi::unhandled_request, octopi::identity_infoton, octopi::octopus_request_id, octopi::octopus_entity, timely::time_locus, timely::day_in_year, timely::clock_time, structures::version, structures::string_table, structures::string_array, structures::string_set, filesystem::file_transfer_header, filesystem::filename_tree, filesystem::filename_list, filesystem::filename, filesystem::file_info, filesystem::directory_tree, geometric::rectangle< numeric_type >, geometric::rectangle< double >, geometric::rectangle< int >, geometric::point< numeric_type >, geometric::point< double >, geometric::point< int >, geometric::angle< contents >, and geometric::angle< double >.
|
pure 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.
Implemented in structures::version, synchronic::synchronizable, octopi::infoton, octopi::security_infoton, octopi::file_transfer_infoton, octopi::encryption_wrapper, octopi::encryption_infoton, sockets::machine_uid, sockets::internet_address, octopi::unhandled_request, octopi::identity_infoton, octopi::octopus_request_id, octopi::octopus_entity, timely::time_locus, timely::day_in_year, timely::clock_time, structures::string_table, structures::string_array, structures::string_set, filesystem::file_transfer_header, filesystem::filename_tree, filesystem::filename_list, filesystem::filename, filesystem::file_info, filesystem::directory_tree, geometric::rectangle< numeric_type >, geometric::rectangle< double >, geometric::rectangle< int >, geometric::point< numeric_type >, geometric::point< double >, geometric::point< int >, geometric::angle< contents >, and geometric::angle< double >.
Referenced by nodes::packable_tree::recursive_unpack().