1 #ifndef IDENTITY_TENTACLE_CLASS
2 #define IDENTITY_TENTACLE_CLASS
4 /*****************************************************************************\
6 * Name : identity_tentacle *
7 * Author : Chris Koeritz *
9 *******************************************************************************
10 * Copyright (c) 2002-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
18 #include "identity_infoton.h"
19 #include "tentacle_helper.h"
21 #include <basis/byte_array.h>
22 #include <basis/outcome.h>
23 #include <structures/string_array.h>
27 //! Supports an early step in using octopus services: getting an identity.
29 class identity_tentacle
30 : public tentacle_helper<identity_infoton>
33 identity_tentacle(octopus &parent);
34 //!< the "parent" will provide the real identity services.
36 virtual ~identity_tentacle();
38 DEFINE_CLASS_NAME("identity_tentacle");
40 virtual basis::outcome reconstitute(const structures::string_array &classifier,
41 basis::byte_array &packed_form, infoton * &reformed);
42 //!< reinflates an infoton given that we know the type in "classifier".
43 /*!< recreates a "reformed" infoton from the "classifier" and packed
44 infoton data in "packed_form". this will only succeed if the classifier's
45 first name is understood here. */
47 virtual basis::outcome consume(infoton &to_chow, const octopus_request_id &item_id,
48 basis::byte_array &transformed);
49 //!< chews on the "to_chow" infoton to perform the requested action.
50 /*!< if it's an identity_infoton, then a new identity is provided.
51 otherwise, the identity is given rudimentary checks for validity and
52 the infoton is passed along. */
55 octopus &_parent; //!< provides the real identification service.