New (faster) representation for tags added; faster construction of parentheses
[SXSI/XMLTree.git] / libcds / src / utils / alphabet_mapper.h
index 125e0c6..faef2ff 100644 (file)
@@ -26,6 +26,7 @@
 #include <iostream>
 
 #define ALPHABET_MAPPER_NONE_HDR 2
+#define ALPHABET_MAPPER_CONT_HDR 3
 
 using namespace std;
 
@@ -35,14 +36,25 @@ using namespace std;
  */
 class alphabet_mapper {
   public:
+               alphabet_mapper();
     virtual ~alphabet_mapper() {}
+    /** Maps the symbol */
     virtual uint map(uint s)=0;
+    /** Unmaps the symbol */
     virtual uint unmap(uint s)=0;
+    /** Returns the size of the mapper */
     virtual uint size()=0;
+    /** Saves the mapper to a file */
     virtual uint save(FILE *fp)=0;
+    /** Loads the mapper from a file */
     static alphabet_mapper * load(FILE * fp);
+               virtual void use();
+               virtual void unuse();
+       protected:
+               uint user_count;
 };
 
 #include <alphabet_mapper_none.h>
+#include <alphabet_mapper_cont.h>
 
 #endif /* _ALPHABET_MAPPER_H */