1 #ifndef TENTACLE_HELPER_CLASS
2 #define TENTACLE_HELPER_CLASS
43 template <
class contents>
48 contents *inf =
new contents;
49 if (!inf->unpack(packed_form)) {
66 template <
class contents>
void reset(int number=0, const contents *initial_contents=NULL_POINTER)
Resizes this array and sets the contents from an array of contents.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
An infoton is an individual request parcel with accompanying information.
void set_classifier(const structures::string_array &new_classifier)
sets the infoton's classifier to the "new_classifier".
Provides a way of identifying users of an octopus object.
Identifies requests made on an octopus by users.
provides prefab implementations for parts of the tentacle object.
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.
virtual ~tentacle_helper()
force a virtual destructor.
virtual void expunge(const octopus_entity &formal(to_remove))
no general actions for expunge; they are all class-specific.
virtual basis::outcome consume(infoton &formal(to_chow), const octopus_request_id &formal(item_id), basis::byte_array &transformed)
consume is not really provided here. remember to implement for servers!
tentacle_helper(const structures::string_array &classifier, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE)
Manages a service within an octopus by processing certain infotons.
int motivational_rate() const
returns the background processing rate this was constructed with.
@ NO_HANDLER
no handler for that type of infoton.
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.
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
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.