]> git.tdb.fi Git - libs/gl.git/blobdiff - source/tag.cpp
Add a Tag class to identify passes
[libs/gl.git] / source / tag.cpp
diff --git a/source/tag.cpp b/source/tag.cpp
new file mode 100644 (file)
index 0000000..c8041e0
--- /dev/null
@@ -0,0 +1,21 @@
+#include "tag.h"
+
+namespace Msp {
+namespace GL {
+
+Tag::Tag(const char *s):
+       id(0)
+{
+       for(const char *i=s; *i; ++i)
+               id=id*id+*i;
+}
+
+Tag::Tag(const std::string &s):
+       id(0)
+{
+       for(std::string::const_iterator i=s.begin(); i!=s.end(); ++i)
+               id=id*id+*i;
+}
+
+} // namespace GL
+} // namespace Msp