summaryrefslogtreecommitdiffstats
path: root/ue3/mycpu/cdat.h
diff options
context:
space:
mode:
Diffstat (limited to 'ue3/mycpu/cdat.h')
-rw-r--r--ue3/mycpu/cdat.h249
1 files changed, 249 insertions, 0 deletions
diff --git a/ue3/mycpu/cdat.h b/ue3/mycpu/cdat.h
new file mode 100644
index 0000000..8b067f9
--- /dev/null
+++ b/ue3/mycpu/cdat.h
@@ -0,0 +1,249 @@
1/**
2 * @module cdat
3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
4 * @brief TODO
5 * @date 10.05.2009
6 */
7
8#ifndef CDAT_H
9#define CDAT_H
10
11#include <boost/operators.hpp>
12#include <iostream>
13
14/**
15 * @class CDat
16 *
17 * TODO
18 *
19 * On error TODO will be thrown.
20 */
21class CDat
22 : boost::operators<CDat>
23{
24 public:
25 /**
26 * @method CDat
27 * @brief Default ctor
28 * @param -
29 * @return -
30 * @globalvars none
31 * @exception bad_alloc
32 * @conditions none
33 */
34 CDat()
35 {}
36
37 /**
38 * @method ~CDat
39 * @brief Default dtor
40 * @param -
41 * @return -
42 * @globalvars none
43 * @exception none
44 * @conditions none
45 */
46 ~CDat()
47 {}
48
49 /**
50 * @method CDat
51 * @brief Copy constructor for CDat
52 * @param other reference to CDat which will be copied
53 * @return -
54 * @globalvars none
55 * @exception none
56 * @conditions none
57 */
58 CDat(const CDat& other)
59 : m_value(other.m_value)
60 {}
61
62 /**
63 * @method CDat
64 * @brief Copy constructor for int
65 * @param newval new value for CDat
66 * @return -
67 * @globalvars none
68 * @exception none
69 * @conditions none
70 */
71 CDat(int newval)
72 : m_value(newval)
73 {}
74
75 /**
76 * @method value
77 * @brief returns value of CDat
78 * @param -
79 * @return value of CDat
80 * @globalvars none
81 * @exception none
82 * @conditions none
83 */
84 int value() const;
85
86 /**
87 * @method operator<
88 * @brief implementation of operator <
89 * @param reference to CDat
90 * @return true if cdat is less than object x
91 * @globalvars none
92 * @exception none
93 * @conditions none
94 */
95 bool operator<(const CDat& x) const;
96
97 /**
98 * @method operator==
99 * @brief implementation of operator ==
100 * @param reference to CDat
101 * @return true if cdat equals object x
102 * @globalvars none
103 * @exception none
104 * @conditions none
105 */
106 bool operator==(const CDat& x) const;
107
108 /**
109 * @method operator+=
110 * @brief implementation of operator +=
111 * @param reference to CDat
112 * @return refecence to CDat
113 * @globalvars none
114 * @exception none
115 * @conditions none
116 */
117 CDat& operator+=(const CDat& x);
118
119 /**
120 * @method operator-=
121 * @brief implementation of operator -=
122 * @param reference to CDat
123 * @return refecence to CDat
124 * @globalvars none
125 * @exception none
126 * @conditions none
127 */
128 CDat& operator-=(const CDat& x);
129
130 /**
131 * @method operator*=
132 * @brief implementation of operator *=
133 * @param reference to CDat
134 * @return refecence to CDat
135 * @globalvars none
136 * @exception none
137 * @conditions none
138 */
139 CDat& operator*=(const CDat& x);
140
141 /**
142 * @method operator/=
143 * @brief implementation of operator /=
144 * @param reference to CDat
145 * @return refecence to CDat
146 * @globalvars none
147 * @exception none
148 * @conditions none
149 */
150 CDat& operator/=(const CDat& x);
151
152 /**
153 * @method operator%=
154 * @brief implementation of operator %=
155 * @param reference to CDat
156 * @return refecence to CDat
157 * @globalvars none
158 * @exception none
159 * @conditions none
160 */
161 CDat& operator%=(const CDat& x);
162
163 /**
164 * @method operator|=
165 * @brief implementation of operator |=
166 * @param reference to CDat
167 * @return refecence to CDat
168 * @globalvars none
169 * @exception none
170 * @conditions none
171 */
172 CDat& operator|=(const CDat& x);
173
174 /**
175 * @method operator&=
176 * @brief implementation of operator &=
177 * @param reference to CDat
178 * @return refecence to CDat
179 * @globalvars none
180 * @exception none
181 * @conditions none
182 */
183 CDat& operator&=(const CDat& x);
184
185 /**
186 * @method operator^=
187 * @brief implementation of operator ^=
188 * @param reference to CDat
189 * @return refecence to CDat
190 * @globalvars none
191 * @exception none
192 * @conditions none
193 */
194 CDat& operator^=(const CDat& x);
195
196 /**
197 * @method operator++
198 * @brief implementation of operator ++
199 * @param -
200 * @return refecence to CDat
201 * @globalvars none
202 * @exception none
203 * @conditions none
204 */
205 CDat& operator++();
206
207 /**
208 * @method operator--
209 * @brief implementation of operator --
210 * @param -
211 * @return refecence to CDat
212 * @globalvars none
213 * @exception none
214 * @conditions none
215 */
216 CDat& operator--();
217
218 /**
219 * @method operator<<
220 * @brief Shift/output operator for outputstream
221 * @param stream reference to outputstream
222 * @param cdat object which will be printed to stream
223 * @return reference to outputstream
224 * @globalvars none
225 * @exception none
226 * @conditions none
227 */
228 friend std::ostream& operator<<(std::ostream& stream, CDat cdat);
229
230 /**
231 * @method operator>>
232 * @brief Shift/read operator for inputstream
233 * @param stream reference to inputstream
234 * @param cdat reference to object which will be read from stream
235 * @return reference to inputstream
236 * @globalvars none
237 * @exception none
238 * @conditions none
239 */
240 friend std::istream& operator>>(std::istream & stream, CDat& cdat);
241
242 private:
243 /* members */
244 int m_value;
245};
246
247#endif
248
249/* vim: set et sw=2 ts=2: */