X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftag.h;fp=source%2Fcore%2Ftag.h;h=dbc0b3ef47819470b17440642650dc9e6ee76ce4;hb=fa2b4c8a93ebad2497cacfdeaa9a2c20be486520;hp=0000000000000000000000000000000000000000;hpb=20622e74de6753c5e4460a112c11ee913707e8e8;p=libs%2Fgl.git diff --git a/source/core/tag.h b/source/core/tag.h new file mode 100644 index 00000000..dbc0b3ef --- /dev/null +++ b/source/core/tag.h @@ -0,0 +1,34 @@ +#ifndef MSP_GL_TAG_H_ +#define MSP_GL_TAG_H_ + +#include +#include + +namespace Msp { +namespace GL { + +/** +Provides transparent string-to-hash conversion for faster comparison. An empty +string is guaranteed to have an id of 0. +*/ +struct Tag +{ + unsigned id; + + Tag(): id(0) { } + Tag(const char *); + Tag(const std::string &s); + + std::string str() const; + + bool operator<(Tag t) const { return id