1 //------------------------------------------------------------------------------
2 // MessageBPointItemTest.h
4 //------------------------------------------------------------------------------
6 #ifndef MESSAGEBPOINTITEMTEST_H
7 #define MESSAGEBPOINTITEMTEST_H
9 // Standard Includes -----------------------------------------------------------
11 // System Includes -------------------------------------------------------------
13 // Project Includes ------------------------------------------------------------
15 // Local Includes --------------------------------------------------------------
16 #include "MessageItemTest.h"
18 // Local Defines ---------------------------------------------------------------
20 // Globals ---------------------------------------------------------------------
22 typedef TMessageItemFuncPolicy
30 &BMessage::ReplacePoint
34 struct TPointInitPolicy
: public ArrayTypeBase
<BPoint
>
36 inline static BPoint
Zero() { return BPoint(0.0, 0.0); }
37 inline static BPoint
Test1() { return BPoint(10.0, 10.0); }
38 inline static BPoint
Test2() { return BPoint(20.0, 20.0); }
39 inline static size_t SizeOf(const BPoint
&) { return sizeof (BPoint
); }
40 inline static ArrayType
Array()
43 array
.push_back(BPoint(30.0, 30.0));
44 array
.push_back(BPoint(40.0, 40.0));
45 array
.push_back(BPoint(50.0, 50.0));
50 struct TPointAssertPolicy
52 inline static BPoint
Zero() { return BPoint(0.0, 0.0); }
53 inline static BPoint
Invalid() { return BPoint(0.0, 0.0); }
54 inline static bool Size(size_t size
, BPoint
& p
)
55 { return size
== sizeof (p
); }
58 typedef TMessageItemTest
66 TMessageBPointItemTest
;
68 std::ostream
& operator<<(std::ostream
& os
, const BPoint
& point
)
70 int precision
= os
.precision();
71 os
<< "point(x:" << point
.x
<< ", y:" << point
.y
;
72 os
.precision(precision
);
76 #endif // MESSAGEBPOINTITEMTEST_H