encryption_wrapper.h

Go to the documentation of this file.
00001 #ifndef ENCRYPTION_WRAPPER_CLASS
00002 #define ENCRYPTION_WRAPPER_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : encryption_wrapper                                                *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2004-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include <octopus/entity_defs.h>
00019 #include <octopus/infoton.h>
00020 #include <octopus/tentacle_helper.h>
00021 
00022 namespace octopi {
00023 
00025 
00029 class encryption_wrapper : public infoton
00030 {
00031 public:
00032   basis::byte_array _wrapped;
00034 
00037   encryption_wrapper(const basis::byte_array &wrapped = basis::byte_array::empty_array());
00038 
00039   encryption_wrapper(const encryption_wrapper &to_copy);
00040 
00041   virtual ~encryption_wrapper();
00042 
00043   DEFINE_CLASS_NAME("encryption_wrapper");
00044 
00045   encryption_wrapper &operator =(const encryption_wrapper &to_copy);
00046 
00047   void text_form(basis::base_string &fill) const {
00048     fill.assign(basis::astring(class_name()));  // low exposure for vital held info.
00049   }
00050 
00051   static const structures::string_array &encryption_classifier();
00053 
00054   virtual void pack(basis::byte_array &packed_form) const;
00055   virtual bool unpack(basis::byte_array &packed_form);
00056 
00057   virtual clonable *clone() const;
00058 
00059   virtual int packed_size() const;
00060 };
00061 
00063 
00065 
00069 class unwrapping_tentacle
00070 : public tentacle_helper<encryption_wrapper>
00071 {
00072 public:
00073   unwrapping_tentacle();
00074   virtual ~unwrapping_tentacle();
00075 
00076   DEFINE_CLASS_NAME("unwrapping_tentacle");
00077 
00078   virtual basis::outcome reconstitute(const structures::string_array &classifier,
00079           basis::byte_array &packed_form, infoton * &reformed);
00080 
00081   virtual basis::outcome consume(infoton &to_chow, const octopus_request_id &item_id,
00082           basis::byte_array &transformed);
00084 };
00085 
00086 } //namespace.
00087 
00088 #endif  // outer guard.
00089 
Generated on Sat Jan 28 04:22:50 2012 for hoople2 project by  doxygen 1.6.3