projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Small bug fix
[SXSI/XMLTree.git]
/
libcds
/
src
/
utils
/
alphabet_mapper.h
diff --git
a/libcds/src/utils/alphabet_mapper.h
b/libcds/src/utils/alphabet_mapper.h
index
125e0c6
..
faef2ff
100644
(file)
--- a/
libcds/src/utils/alphabet_mapper.h
+++ b/
libcds/src/utils/alphabet_mapper.h
@@
-26,6
+26,7
@@
#include <iostream>
#define ALPHABET_MAPPER_NONE_HDR 2
#include <iostream>
#define ALPHABET_MAPPER_NONE_HDR 2
+#define ALPHABET_MAPPER_CONT_HDR 3
using namespace std;
using namespace std;
@@
-35,14
+36,25
@@
using namespace std;
*/
class alphabet_mapper {
public:
*/
class alphabet_mapper {
public:
+ alphabet_mapper();
virtual ~alphabet_mapper() {}
virtual ~alphabet_mapper() {}
+ /** Maps the symbol */
virtual uint map(uint s)=0;
virtual uint map(uint s)=0;
+ /** Unmaps the symbol */
virtual uint unmap(uint s)=0;
virtual uint unmap(uint s)=0;
+ /** Returns the size of the mapper */
virtual uint size()=0;
virtual uint size()=0;
+ /** Saves the mapper to a file */
virtual uint save(FILE *fp)=0;
virtual uint save(FILE *fp)=0;
+ /** Loads the mapper from a file */
static alphabet_mapper * load(FILE * fp);
static alphabet_mapper * load(FILE * fp);
+ virtual void use();
+ virtual void unuse();
+ protected:
+ uint user_count;
};
#include <alphabet_mapper_none.h>
};
#include <alphabet_mapper_none.h>
+#include <alphabet_mapper_cont.h>
#endif /* _ALPHABET_MAPPER_H */
#endif /* _ALPHABET_MAPPER_H */