-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataNode.h
More file actions
34 lines (24 loc) · 753 Bytes
/
DataNode.h
File metadata and controls
34 lines (24 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// DataNode.h
#include <cstdlib>
#include <iostream>
#include <string>
#include <memory>
#ifndef DATANODE_H
#define DATANODE_H
class DataNode {
protected:
std::string key; // the first two letters of the string
std::string data;
std::shared_ptr<DataNode> next;
public:
DataNode();
DataNode(std::string word);
std::string setKey(); // gets the first two letters of the given word
// getters and setters
std::string getData();
void setData(std::string word);
std::shared_ptr<DataNode> getNext();
void setNext(std::shared_ptr<DataNode> node);
std::string getKey();
}; // end class declaration
#endif /* DATANODE_H */