Moka libraries
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
int-att.hh
Go to the documentation of this file.
1
/*
2
* lib-spamod : Visualisation des objets en discret.
3
* Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4
* http://www.sic.sp2mi.univ-poitiers.fr/
5
* Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6
* guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7
*
8
* This file is part of lib-spamod
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU Lesser General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
19
*
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
24
/******************************************************************************
25
* Fichier : Int_Att.h *
26
* Auteur : DEXET Martine *
27
*----------------------------------------------------------------------------*
28
* Ce fichier contient la spécification de la classe Int_Att. Cette *
29
* classe permet de stocker un entier en tant qu'attribut. *
30
* *
31
*****************************************************************************/
32
33
34
#ifndef INT_ATT_H
35
#define INT_ATT_H
36
37
#include "attribute.hh"
38
39
40
41
/******************************************************************************
42
* Classe Int_Att *
43
*****************************************************************************/
44
45
class
Int_Att
:
public
CAttribute {
46
47
public
:
48
49
// Constructeurs.
50
Int_Att
();
51
Int_Att
(
int
v);
52
53
// Destructeur.
54
virtual
~Int_Att
();
55
56
// Surcharge des méthodes de la classe CAttribute.
57
TAttributeId
getType
()
const
;
58
int
*
Get_Data
();
59
CAttribute *
copy
()
const
;
60
void
destroy
();
61
void
save
(std::ostream &fd)
const
;
62
void
load
(std::istream &fd);
63
64
private
:
65
66
// Pointeur sur un entier.
67
int
* value;
68
};
69
70
/******************************************************************************
71
* Fichier : Int_Att.inl *
72
* Auteur : DEXET Martine *
73
*----------------------------------------------------------------------------*
74
* Ce fichier contient l'implémentation des méthodes de la classe *
75
* Int_Att. *
76
* *
77
*****************************************************************************/
78
79
#include "
user.hh
"
80
81
// Constructeurs.
82
inline
83
Int_Att::Int_Att
()
84
{
85
value =
new
int;
86
}
87
88
inline
89
Int_Att::Int_Att
(
int
v)
90
{
91
value =
new
int(v);
92
}
93
94
95
// Destructeur.
96
inline
97
Int_Att::~Int_Att
()
98
{
99
delete
value;
100
}
101
102
103
// Surcharge des méthodes de la classe CAttribute.
104
inline
105
TAttributeId
Int_Att::getType
()
const
106
{
107
return
INT_ATTRIBUTE_ID
;
108
}
109
110
inline
111
int
*
Int_Att::Get_Data
()
112
{
113
return
value;
114
}
115
116
inline
117
CAttribute *
Int_Att::copy
()
const
118
{
119
return
new
Int_Att
(*value);
120
}
121
122
inline
123
void
Int_Att::destroy
()
124
{
125
delete
this
;
126
}
127
128
129
inline
130
void
Int_Att::save
(std::ostream &fd)
const
131
{
132
fd << *value << std::endl;
133
}
134
135
inline
136
void
Int_Att::load
(std::istream &fd)
137
{
138
}
139
140
#endif
lib-spamod
main
attributes
int-att.hh
Generated on Tue Apr 9 2013 09:51:42 for Moka libraries by
1.8.2