22 using namespace basis;
29 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
31 encryption_wrapper::encryption_wrapper(
const byte_array &wrapped)
32 :
infoton(encryption_classifier()),
39 _wrapped(to_copy._wrapped)
45 {
return cloner<encryption_wrapper>(*
this); }
50 if (
this == &to_copy)
return *
this;
101 LOG(
"should never enter this method.");
102 return common::NOT_IMPLEMENTED;
void reset(int number=0, const contents *initial_contents=NULL_POINTER)
Resizes this array and sets the contents from an array of contents.
int length() const
Returns the current reported length of the allocated C array.
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.
Wraps an encrypted infoton when the octopus is in an encrypted mode.
virtual clonable * clone() const
must be provided to allow creation of a copy of this object.
virtual bool unpack(basis::byte_array &packed_form)
restores an infoton from a packed form.
static const structures::string_array & encryption_classifier()
returns the classifier for this type of infoton.
encryption_wrapper(const basis::byte_array &wrapped=basis::byte_array::empty_array())
virtual int packed_size() const
reports how large the infoton will be when packed.
basis::byte_array _wrapped
the encrypted data that's held here.
virtual ~encryption_wrapper()
virtual void pack(basis::byte_array &packed_form) const
stuffs the data in the infoton into the "packed_form".
An infoton is an individual request parcel with accompanying information.
Identifies requests made on an octopus by users.
provides prefab implementations for parts of the tentacle object.
@ NO_HANDLER
no handler for that type of infoton.
virtual basis::outcome consume(infoton &to_chow, const octopus_request_id &item_id, basis::byte_array &transformed)
this should never be called.
virtual ~unwrapping_tentacle()
virtual basis::outcome reconstitute(const structures::string_array &classifier, basis::byte_array &packed_form, infoton *&reformed)
this is a simple enough action that it is totally automated.
An array of strings with some additional helpful methods.
#define formal(parameter)
This macro just eats what it's passed; it marks unused formal parameters.
#define NULL_POINTER
The value representing a pointer to nothing.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
The guards collection helps in testing preconditions and reporting errors.
A logger that sends to the console screen using the standard output device.
basis::outcome reconstituter(const structures::string_array &classifier, basis::byte_array &packed_form, infoton *&reformed, contents *formal(junk))
< reconstituter should work for most infotons to restore flattened infotons.
SAFE_STATIC_CONST(string_array, identity_infoton::identity_classifier,(1, identity_classifier_strings)) int identity_infoton
const char * wrap_encryption_classifier[]
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".