-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dg2WayConverter.h
58 lines (42 loc) · 1.71 KB
/
Dg2WayConverter.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
56
57
58
////////////////////////////////////////////////////////////////////////////////
//
// Dg2WayConverter.h: Dg2WayConverter class definitions
//
// Version 6.1 - Kevin Sahr, 5/23/13
//
////////////////////////////////////////////////////////////////////////////////
#ifndef DG2WAYCONVERTER_H
#define DG2WAYCONVERTER_H
class DgRFBase;
////////////////////////////////////////////////////////////////////////////////
class Dg2WayConverter {
public:
Dg2WayConverter (const DgConverterBase& forward,
const DgConverterBase& inverse);
Dg2WayConverter (const Dg2WayConverter& con)
: forward_ (&con.forward()), inverse_ (&con.inverse()) {}
Dg2WayConverter& operator= (const Dg2WayConverter& con)
{ forward_ = &con.forward(); inverse_ = &con.inverse();
return *this; }
const DgConverterBase& forward (void) const { return *forward_; }
const DgConverterBase& inverse (void) const { return *inverse_; }
protected:
const DgConverterBase* forward_;
const DgConverterBase* inverse_;
};
////////////////////////////////////////////////////////////////////////////////
inline
Dg2WayConverter::Dg2WayConverter (const DgConverterBase& forward,
const DgConverterBase& inverse)
{
if (forward.fromFrame() != inverse.toFrame() ||
forward.toFrame() != inverse.fromFrame())
{
report("Dg2WayConverter::Dg2WayConverter() rf mismatch", DgBase::Fatal);
}
forward_ = &forward;
inverse_ = &inverse;
} // Dg2WayConverter::Dg2WayConverter
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#endif