Bachelors_Thesis_Code/helper_code/fagprojekt_code/hashed_string.hpp
Knyffen 03ec008d0d A bit of cleanup
Move some helper files to other folders.

Actually remove the .sage files from the main directory, as I wrote I
would in the readme.
2021-11-14 14:48:58 +01:00

35 lines
862 B
C++

#ifndef HASHED_OBJECT_H
#define HASHED_OBJECT_H
#include <string>
struct My_string {
char * chars;
size_t size;
My_string(char *, size_t);
~My_string();
bool operator==(const My_string& other);
};
struct Hashed_string {
Hashed_string * next = NULL;
Hashed_string * previous = NULL;
bool last_element = true;
bool initializer = false; // signal the object to act as the "link" between the its reference and the linked list of hashed elemenets. This instance DOES NOT represent a hashed value.
My_string string;
unsigned int appearances = 1;
Hashed_string();
Hashed_string(My_string * s);
Hashed_string(Hashed_string * hs);
~Hashed_string();
int append(Hashed_string * new_string); // returns 1 if the word was new and 0 otherwise.
void remove(Hashed_string * removed_string);
};
#endif