40 #ifndef _HashedString_cpp
41 #define _HashedString_cpp
44 #include "Internal/murmurhash3.h.cpp"
62 TheString(StartingString), Hash(Murmur32bit(StartingString))
66 TheString(StartingString), Hash(PrecomputedHash)
70 TheString(StartingString.TheString), Hash(StartingString.Hash)
126 if( VersionAttr && HashAttr && StringAttr )
159 {
return String(
"HashedString32"); }
int32_t Int32
An 32-bit integer.
#define HASHED_STRING_32_SEED
A value used to tweak the hash function for maximum randomness.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
A light-weight handle for manipulating attributes in DOM tree.
static Int32 Murmur32bit(const String &ToBeHashed)
Compute a MurmurA aka MurmurX86-32bit has of a string and return it.
String ToString(const T &Datum)
Converts whatever to a String as long as a streaming operator is available for it.
bool operator==(const HashedString32 &Other) const
Compare The hash of this and another string for equality.
String GetString() const
Get the string that was used to calculate the hash.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
std::ostream & Serialize(std::ostream &Stream, const T &Converted, const String &Indent=String(""))
Convert any class that supports serialization or has a serializer to a string of chars in a stream...
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
bool operator<(const HashedString32 &Other) const
Provide a semantically useless, but quite fast sorting order for std containers based on only hashes...
Int32 Hash
The computed hash.
void SetString(const String &NewString)
Set a new string and recalculate its hash.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
This implements the exception hiearchy for Mezzanine.
Int32 GetHash() const
Get the 32 bit as an Int32.
std::ostream & operator<<(std::ostream &stream, const Mezzanine::HashedString32 &x)
Send a HashedString32 down a stream serialized.
The interface for serialization.
An identifier that compares as fast as an integer but has a string.
bool SetValue(const Char8 *rhs)
Set the value of this.
A light-weight handle for manipulating nodes in DOM tree.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
Integer AsInteger(Integer def=0) const
Attempts to convert the value of the attribute to a Integer and returns the results.
bool operator!=(const HashedString32 &Other) const
Compare The hash of this and another string for inequality.
bool operator>(const HashedString32 &Other) const
Provide a semantically useless, but quite fast sorting order for std containers based on only hashes...
Thrown when the identity string wasn't valid at all.
The bulk of the engine components go in this namspace.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
HashedString32()
NonComputing Constructor.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
String TheString
The Actual string to store.
std::string String
A datatype used to a series of characters.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.