-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstance.h
48 lines (37 loc) · 1.21 KB
/
instance.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
#ifndef INSTANCE_H_
#define INSTANCE_H_
#include <string>
#include <iostream>
#include <sstream>
#include <stdlib.h>
using namespace std;
typedef struct message //αντι για 3 πινακες , φτιαχνουμε ενα struct-πινακα που περιεχει
{ //3 στοιχεια στην καθε θεση.
string keyword;
unsigned id;
unsigned frequency;
}message;
class Instance {
private: //δηλωσεις μεταβλητων
unsigned features;
bool category;
string fileName;
message *elements;
public: //δηλωσεις μεθοδων
Instance(unsigned features=0);
unsigned getNumberOfFeatures() const;
Instance(const Instance& original);
~Instance();
void setCategory(bool category);
bool getCategory() const;
void setFileName(const string& fileName);
string getFileName() const;
void setFeature(unsigned i, const string& feature, unsigned featureID,unsigned frequency);
string getFeature(unsigned i) const;
unsigned getFeatureID(unsigned i) const;
unsigned getFrequency(unsigned i) const;
Instance& operator=(const Instance& right);
friend ostream& operator<<(ostream& out, const Instance& inst);
friend istream& operator>>(istream& in, Instance& inst);
};
#endif