-
Notifications
You must be signed in to change notification settings - Fork 0
/
end_point.h
69 lines (51 loc) · 1.36 KB
/
end_point.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
59
60
61
62
63
64
65
66
67
68
69
/*
* end_point.h
*
* Created on: 28/set/2012
* Author: vincenzo
*/
#ifndef END_POINT_H_
#define END_POINT_H_
#include <boost/shared_ptr.hpp>
#include <boost/serialization/access.hpp>
#include <sigc++/sigc++.h>
#include <string>
#include <point.h>
using boost::shared_ptr;
using std::string;
namespace cppgef
{
class EndPoint
{
public:
typedef string direction_t;
typedef sigc::signal< void > signal_property_changed_t;
static const char* DIRECTION_START;
static const char* DIRECTION_END;
public:
EndPoint();
virtual ~EndPoint();
direction_t GetDirection() const;
void SetDirection(const direction_t& direction);
shared_ptr<Point> GetRefPoint();
void SetRefPoint(const shared_ptr<Point>& ref_point);
signal_property_changed_t signalRefPointChanged();
signal_property_changed_t signalDirectionChanged();
signal_property_changed_t signalPositionChanged();
protected:
shared_ptr< Point > ref_point_;
direction_t direction_;
// Signal instances
signal_property_changed_t signal_ref_point_changed_;
signal_property_changed_t signal_direction_changed_;
signal_property_changed_t signal_position_changed_;
protected:
void onPositionChanged();
private:
// Serialization
friend class boost::serialization::access;
template< class Archive >
void serialize(Archive & ar, const unsigned int version);
};
} /* namespace cppgef */
#endif /* END_POINT_H_ */