-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDato.h
55 lines (39 loc) · 1.01 KB
/
Dato.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
#ifndef DATO_H_
#define DATO_H_
#include "Tipos.h"
#include "aed2/Conj.h"
#include "aed2/Lista.h"
#include "aed2/Dicc.h"
#include "aed2/Dupla.h"
#include "aed2/TiposBasicos.h"
//~ typedef aed2::String NombreTabla;
//~ typedef aed2::String NombreCampo;
//~ enum TipoCampo { Nat, Str };
namespace tp3
{
/**
* Esta clase representa un dato, que puede tomar valores de String o de Nat.
*/
class Dato
{
public:
Dato(const aed2::Nat& x);
Dato(const aed2::String& x);
bool esNat() const;
bool esString() const;
aed2::TipoCampo tipo() const;
const aed2::Nat& dameNat() const;
const aed2::String& dameString() const;
bool operator == (const Dato& otro) const;
bool operator < (const Dato& otro) const;
bool operator > (const Dato& otro) const;
bool operator != (const Dato& otro) const;
static Dato max(const aed2::Conj<Dato> cd);
static Dato min(const aed2::Conj<Dato> cd);
private:
aed2::TipoCampo tipo_;
aed2::Nat nat_;
aed2::String str_;
};
}; // namespace tp3
#endif // DATO_H_