1 /*****************************************************************************\
3 * Name : identity_infoton *
4 * Author : Chris Koeritz *
6 *******************************************************************************
7 * Copyright (c) 2002-$now By Author. This program is free software; you can *
8 * redistribute it and/or modify it under the terms of the GNU General Public *
9 * License as published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) any later version. This is online at: *
11 * http://www.fsf.org/copyleft/gpl.html *
12 * Please send any updates to: fred@gruntose.com *
13 \*****************************************************************************/
15 #include "identity_infoton.h"
18 #include <basis/byte_array.h>
19 #include <basis/mutex.h>
20 #include <structures/string_array.h>
21 #include <structures/static_memory_gremlin.h>
23 using namespace basis;
24 using namespace structures;
28 identity_infoton::identity_infoton()
29 : infoton(identity_classifier()),
33 identity_infoton::identity_infoton(const octopus_entity &uid)
34 : infoton(identity_classifier()),
38 identity_infoton::identity_infoton(const identity_infoton &to_copy)
41 _new_name(to_copy._new_name)
44 identity_infoton::~identity_infoton() {}
46 void identity_infoton::text_form(base_string &fill) const
49 _new_name.text_form(ent_info);
50 fill.assign(astring("entity=") + ent_info);
53 identity_infoton &identity_infoton::operator =(const identity_infoton &to_copy)
55 if (this == &to_copy) return *this;
56 set_classifier(to_copy.classifier());
57 _new_name = to_copy._new_name;
61 const astring identity_classifier_strings[] = { "#octide" };
63 SAFE_STATIC_CONST(string_array, identity_infoton::identity_classifier,
64 (1, identity_classifier_strings))
66 int identity_infoton::packed_size() const { return _new_name.packed_size(); }
68 clonable *identity_infoton::clone() const
69 { return cloner<identity_infoton>(*this); }
71 void identity_infoton::pack(byte_array &packed_form) const
72 { _new_name.pack(packed_form); }
74 bool identity_infoton::unpack(byte_array &packed_form)
76 if (!_new_name.unpack(packed_form)) return false;