-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobservable.cpp
More file actions
36 lines (29 loc) · 852 Bytes
/
observable.cpp
File metadata and controls
36 lines (29 loc) · 852 Bytes
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
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// o b s e r v a b l e . c p p
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
// T.R. Sokolowski
// 2011
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "observable.hpp"
observable::observable(void)
{
}
observable& observable::operator=(const observable& o)
{
number = o.number;
strcpy(name, o.name);
no_components = o.no_components;
for(int i=0; i<no_components; i++) component[i] = o.component[i];
value = o.value;
threshold = o.threshold;
}
void observable::info(void)
{
printf("Observable %u = %s \n", number, name);
printf("no_components = %u \n", no_components);
for(int i=0; i<no_components; i++)
printf("\t component %u = %u \n", i, component[i]);
printf("threshold = %g \n", threshold);
printf("value = %g \n\n", value);
}