#include <iostream>
#define ALPHABET_MAPPER_NONE_HDR 2
+#define ALPHABET_MAPPER_CONT_HDR 3
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 */