00001 #ifndef IDENTITY_INFOTON_IMPLEMENTATION_FILE 00002 #define IDENTITY_INFOTON_IMPLEMENTATION_FILE 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : identity_infoton * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2002-$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 "identity_infoton.h" 00019 #include "tentacle.h" 00020 00021 #include <basis/byte_array.h> 00022 #include <basis/mutex.h> 00023 #include <basis/string_array.h> 00024 #include <data_struct/static_memory_gremlin.h> 00025 00026 identity_infoton::identity_infoton() 00027 : infoton(identity_classifier()), 00028 _new_name() 00029 {} 00030 00031 identity_infoton::identity_infoton(const octopus_entity &uid) 00032 : infoton(identity_classifier()), 00033 _new_name(uid) 00034 {} 00035 00036 identity_infoton::identity_infoton(const identity_infoton &to_copy) 00037 : object_base(), 00038 infoton(to_copy), 00039 _new_name(to_copy._new_name) 00040 {} 00041 00042 identity_infoton::~identity_infoton() {} 00043 00044 identity_infoton &identity_infoton::operator =(const identity_infoton &to_copy) 00045 { 00046 if (this == &to_copy) return *this; 00047 set_classifier(to_copy.classifier()); 00048 _new_name = to_copy._new_name; 00049 return *this; 00050 } 00051 00052 const istring identity_classifier_strings[] = { "#octide" }; 00053 00054 SAFE_STATIC_CONST(string_array, identity_infoton::identity_classifier, 00055 (1, identity_classifier_strings)) 00056 00057 int identity_infoton::packed_size() const { return _new_name.packed_size(); } 00058 00059 clonable *identity_infoton::clone() const 00060 { return cloner<identity_infoton>(*this); } 00061 00062 void identity_infoton::pack(byte_array &packed_form) const 00063 { _new_name.pack(packed_form); } 00064 00065 bool identity_infoton::unpack(byte_array &packed_form) 00066 { 00067 if (!_new_name.unpack(packed_form)) return false; 00068 return true; 00069 } 00070 00071 00072 #endif //IDENTITY_INFOTON_IMPLEMENTATION_FILE 00073
1.5.1