X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Futils%2Falphabet_mapper.h;h=9867674ee7a09f1dc088a3e6cad98c6c5009c515;hb=a75155efc2ed07c1907ef017360bd719a47f9c06;hp=125e0c6ee1fbfcb4d6b301cd867f6697f4a3e65a;hpb=0bf9688e2615a9fc07860c5762240e4ce26ee5d3;p=SXSI%2FXMLTree.git diff --git a/libcds/src/utils/alphabet_mapper.h b/libcds/src/utils/alphabet_mapper.h index 125e0c6..9867674 100644 --- a/libcds/src/utils/alphabet_mapper.h +++ b/libcds/src/utils/alphabet_mapper.h @@ -26,8 +26,9 @@ #include #define ALPHABET_MAPPER_NONE_HDR 2 +#define ALPHABET_MAPPER_CONT_HDR 3 -using namespace std; +//using namespace std; /** Base class for alphabet mappers * @@ -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 */