feisty meow concerns codebase  2.140
octopi::tentacle_helper< contents > Class Template Reference

provides prefab implementations for parts of the tentacle object. More...

#include <tentacle_helper.h>

Inheritance diagram for octopi::tentacle_helper< contents >:
Collaboration diagram for octopi::tentacle_helper< contents >:

Public Member Functions

 tentacle_helper (const structures::string_array &classifier, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE)
 
virtual ~tentacle_helper ()
 force a virtual destructor. More...
 
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. More...
 
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! More...
 
virtual void expunge (const octopus_entity &formal(to_remove))
 no general actions for expunge; they are all class-specific. More...
 
- Public Member Functions inherited from octopi::tentacle
 tentacle (const structures::string_array &group_name, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE)
 constructs a tentacle that handles infotons with the "group_name". More...
 
virtual ~tentacle ()
 
 DEFINE_CLASS_NAME ("tentacle")
 
const structures::string_arraygroup () const
 returns the name of the group that this tentacle services. More...
 
bool backgrounding () const
 reports on whether this tentacle supports background operation or not. More...
 
int motivational_rate () const
 returns the background processing rate this was constructed with. More...
 
virtual basis::outcome consume (infoton &to_chow, const octopus_request_id &item_id, basis::byte_array &transformed)=0
 this is the main function that processes infotons for this tentacle. More...
 
virtual void expunge (const octopus_entity &to_remove)=0
 called to remove traces of the entity "to_remove". More...
 
basis::outcome enqueue (infoton *to_chow, const octopus_request_id &item_id)
 holds onto infotons coming from the octopus for backgrounding. More...
 
infotonnext_request (octopus_request_id &item_id)
 pops out the next queued request for processing. More...
 
bool store_product (infoton *product, const octopus_request_id &original_id)
 used by tentacles to store the objects they produce from infotons. More...
 
void attach_storage (entity_data_bin &storage)
 used when a tentacle is being integrated with an octopus. More...
 
void detach_storage ()
 unhooks the storage bin from this tentacle. More...
 
entity_data_binget_storage ()
 returns the current pointer, which might be nil. More...
 
void propel_arm ()
 invoked by our thread to cause requests to be processed. More...
 

Additional Inherited Members

- Public Types inherited from octopi::tentacle
enum  constants { DEFAULT_RATE = 40 }
 
enum  outcomes {
  OKAY = basis::common::OKAY , NOT_FOUND = basis::common::NOT_FOUND , ALREADY_EXISTS = basis::common::EXISTING , BAD_INPUT = basis::common::BAD_INPUT ,
  NO_SPACE = basis::common::NO_SPACE , GARBAGE = basis::common::GARBAGE , DISALLOWED = basis::common::DISALLOWED , NO_HANDLER = basis::common::NO_HANDLER ,
  PARTIAL = basis::common::PARTIAL , ENCRYPTION_MISMATCH = basis::common::ENCRYPTION_MISMATCH
}
 
- Static Public Member Functions inherited from octopi::tentacle
static const char * outcome_name (const basis::outcome &to_name)
 returns the textual form of the outcome "to_name". More...
 

Detailed Description

template<class contents>
class octopi::tentacle_helper< contents >

provides prefab implementations for parts of the tentacle object.

tentacle_helper provides the base functionality of reconstitution that should support most of the simple needs of a user of an octopus. if the octopus will actually implement the request processing (instead of just unpacking returned responses), the consume method needs to be filled in appropriately so that it implements the derived tentacle's purpose.

Definition at line 67 of file tentacle_helper.h.

Constructor & Destructor Documentation

◆ tentacle_helper()

template<class contents >
octopi::tentacle_helper< contents >::tentacle_helper ( const structures::string_array classifier,
bool  backgrounded,
int  motivational_rate = tentacle::DEFAULT_RATE 
)
inline

Definition at line 70 of file tentacle_helper.h.

◆ ~tentacle_helper()

template<class contents >
virtual octopi::tentacle_helper< contents >::~tentacle_helper ( )
inlinevirtual

force a virtual destructor.

Definition at line 74 of file tentacle_helper.h.

Member Function Documentation

◆ consume()

template<class contents >
virtual basis::outcome octopi::tentacle_helper< contents >::consume ( infoton formalto_chow,
const octopus_request_id formalitem_id,
basis::byte_array transformed 
)
inlinevirtual

consume is not really provided here. remember to implement for servers!

consume will generally need to be implemented by a "real" tentacle that is based on the tentacle_helper. in the context of network communications, the server side will generally have a real tentacle that implements consume() while the client side will just have the tentacle_helper version of one, which does nothing.

Definition at line 90 of file tentacle_helper.h.

References octopi::tentacle::NO_HANDLER, and basis::array< contents >::reset().

◆ expunge()

template<class contents >
virtual void octopi::tentacle_helper< contents >::expunge ( const octopus_entity formalto_remove)
inlinevirtual

no general actions for expunge; they are all class-specific.

Definition at line 94 of file tentacle_helper.h.

◆ reconstitute()

template<class contents >
virtual basis::outcome octopi::tentacle_helper< contents >::reconstitute ( const structures::string_array classifier,
basis::byte_array packed_form,
infoton *&  reformed 
)
inlinevirtual

this is a simple enough action that it is totally automated.

Implements octopi::tentacle.

Reimplemented in octopi::login_tentacle, octopi::file_transfer_tentacle, octopi::unwrapping_tentacle, octopi::encryption_tentacle, and octopi::identity_tentacle.

Definition at line 78 of file tentacle_helper.h.

References NULL_POINTER, and octopi::reconstituter().


The documentation for this class was generated from the following file: