-
Notifications
You must be signed in to change notification settings - Fork 0
/
itemKey.h
55 lines (40 loc) · 1.07 KB
/
itemKey.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* ItemKey.h
* ItemKey class was created to store sorting atributes for each movie as an
* object
*
* @author Olga Kuriatnyk
*/
#ifndef ITEMKEY_H
#define ITEMKEY_H
#include <string>
using namespace std;
class ItemKey {
public:
// default constructor
ItemKey() = default;
// explicit constructor
explicit ItemKey(const string &keyTotal);
// explicit constructor
explicit ItemKey(const string &subKey1, const string &subKey2);
// destructor
~ItemKey() = default;
// copy constructor not allowed
ItemKey(const ItemKey &key) = default;
// move not allowed
ItemKey(ItemKey &&other) = default;
// assignment not allowed
ItemKey &operator=(const ItemKey &other) = default;
// move assignment not allowed
ItemKey &operator=(ItemKey &&other) = default;
// @return item key
string getItemKey() const;
// @return true if this < then other
bool operator<(const ItemKey &other) const;
// @return true if objects are equal
bool operator==(const ItemKey &other) const;
private:
// to store sortingAttribute in string
string itemKey;
};
#endif