X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Futils%2Falphabet_mapper.h;h=faef2ffbac1242c3ee6088556548730da0f65741;hb=a9846746dc7a55764591fcc273fd48c6049df962;hp=125e0c6ee1fbfcb4d6b301cd867f6697f4a3e65a;hpb=efe894650813a19a0e1408eb5807e59f037afc3b;p=SXSI%2FXMLTree.git diff --git a/libcds/src/utils/alphabet_mapper.h b/libcds/src/utils/alphabet_mapper.h index 125e0c6..faef2ff 100644 --- a/libcds/src/utils/alphabet_mapper.h +++ b/libcds/src/utils/alphabet_mapper.h @@ -26,6 +26,7 @@ #include #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 +#include #endif /* _ALPHABET_MAPPER_H */