-
Notifications
You must be signed in to change notification settings - Fork 0
/
FunctionSet.CPP
86 lines (67 loc) · 1.4 KB
/
FunctionSet.CPP
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//////// AB CLASSGEN Sun Apr 06 15:37:04 1997 ////////
// FunctionSet Implementation
//////////////////////////////////////////////////////
#include "SwitchMinDLL_Global.h"
#define DLLBLD_SWSYSTEM_FUNCTIONSET
#include "FunctionSet.HPP"
#include <assert.h>
namespace swmin {
typedef std::set<Function, std::less<Function> > set_type;
// default constructor
FunctionSet::FunctionSet()
{
_commonCtorJob();
//...
}
// copy constructor
FunctionSet::FunctionSet(const FunctionSet& y)
: set_type((set_type&) y)
{
_commonCtorJob();
//...
}
// assignment overload
FunctionSet& FunctionSet::operator=(const FunctionSet& y)
{
invariant();
if(this == &y) return *this;
set_type::operator=(y);
return *this;
}
// called from all constructors
void FunctionSet::_commonCtorJob()
{
//...
}
// destructor
FunctionSet::~FunctionSet()
{
//...
}
void FunctionSet::invariant()
{
//...
}
IMPLEMENT_STREAMABLE(FunctionSet);
void FunctionSet::Streamer::Write(opstream& out) const
{
out.writeWord32(GetObject()->size());
iterator i = GetObject()->begin(), e = GetObject()->end();
while (i!=e) {
out << *i;
i++;
}
}
void *FunctionSet::Streamer::Read(ipstream& in, uint32 /*ver*/) const
{
GetObject()->erase(GetObject()->begin(), GetObject()->end());
size_type count;
Function x;
count=in.readWord32();
while (count--) {
in >> x;
GetObject()->insert(x);
}
return GetObject();
}
}