22 #ifndef __M2ETIS_MESSAGE_KEY_H__
23 #define __M2ETIS_MESSAGE_KEY_H__
28 #include "boost/serialization/base_object.hpp"
40 template<
class KeyProv
ider>
41 class Key :
public KeyProvider {
46 Key() : KeyProvider() {
54 KeyProvider::setKey(rval);
61 explicit Key(
const std::string & val) : KeyProvider() {
62 KeyProvider::setKey(val);
65 explicit Key(
const std::vector<unsigned char> & val) : KeyProvider() {
66 KeyProvider::deserialize(val);
69 inline static size_t size() {
70 return KeyProvider::KEYLENGTH;
78 inline std::string
toStr()
const {
79 return KeyProvider::keytoStr();
83 KeyProvider::setKey(rval);
88 return KeyProvider::equals(rval);
92 return !(*
this == rval);
95 bool operator<(const Key<KeyProvider> & rval)
const {
96 return KeyProvider::smaller(rval);
100 return !(*
this < rval) && (*
this != rval);
106 template<
class Archive>
107 void serialize(Archive & ar,
unsigned int ) {
108 ar & boost::serialization::base_object<KeyProvider>(*this);
std::string toStr() const
Gets a string representation of the key.
Key(const std::string &val)
Constructor.
bool operator==(const Key< KeyProvider > &rval) const
Key(const Key &rval)
Copy Constructor.
Key< KeyProvider > & operator=(const Key< KeyProvider > &rval)
bool operator!=(const Key< KeyProvider > &rval) const
Key(const std::vector< unsigned char > &val)
bool operator>(const Key< KeyProvider > &rval) const
friend class boost::serialization::access
Key()
Default constructor.