|
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". | |
| virtual bool | unpack (byte_array &packed_form)=0 |
| Restores the packable from the "packed_form". | |
| virtual int | packed_size () const =0 |
| Estimates the space needed for the packed structure. | |
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 geometric::angle< contents >, geometric::angle< double >, geometric::point< numeric_type >, geometric::point< double >, geometric::point< int >, geometric::rectangle< numeric_type >, geometric::rectangle< double >, geometric::rectangle< int >, filesystem::directory_tree, filesystem::file_info, filesystem::filename, filesystem::filename_list, filesystem::filename_tree, filesystem::file_transfer_header, structures::string_set, structures::string_array, structures::string_table, timely::clock_time, timely::day_in_year, timely::time_locus, octopi::octopus_entity, octopi::octopus_request_id, octopi::identity_infoton, octopi::unhandled_request, sockets::internet_address, sockets::machine_uid, octopi::encryption_infoton, octopi::encryption_wrapper, octopi::file_transfer_infoton, octopi::security_infoton, bubble, octopi::infoton, synchronic::synchronizable, and structures::version.
|
pure virtual |
Estimates the space needed for the packed structure.
Implemented in geometric::angle< contents >, geometric::angle< double >, geometric::point< numeric_type >, geometric::point< double >, geometric::point< int >, geometric::rectangle< numeric_type >, geometric::rectangle< double >, geometric::rectangle< int >, filesystem::directory_tree, filesystem::file_info, filesystem::filename, filesystem::filename_list, filesystem::filename_tree, filesystem::file_transfer_header, structures::string_set, structures::string_array, structures::string_table, structures::version, timely::clock_time, timely::day_in_year, timely::time_locus, octopi::octopus_entity, octopi::octopus_request_id, octopi::identity_infoton, octopi::unhandled_request, sockets::internet_address, sockets::machine_uid, octopi::encryption_infoton, octopi::encryption_wrapper, octopi::file_transfer_infoton, octopi::security_infoton, bubble, octopi::infoton, and synchronic::synchronizable.
|
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 geometric::angle< contents >, geometric::angle< double >, geometric::point< numeric_type >, geometric::point< double >, geometric::point< int >, geometric::rectangle< numeric_type >, geometric::rectangle< double >, geometric::rectangle< int >, filesystem::directory_tree, filesystem::file_info, filesystem::filename, filesystem::filename_list, filesystem::filename_tree, filesystem::file_transfer_header, structures::string_set, structures::string_array, structures::string_table, timely::clock_time, timely::day_in_year, timely::time_locus, octopi::octopus_entity, octopi::octopus_request_id, octopi::identity_infoton, octopi::unhandled_request, sockets::internet_address, sockets::machine_uid, octopi::encryption_infoton, octopi::encryption_wrapper, octopi::file_transfer_infoton, octopi::security_infoton, bubble, octopi::infoton, synchronic::synchronizable, and structures::version.
Referenced by nodes::packable_tree::recursive_unpack().