forked from reenigne/reenigne
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhierarchy_skeleton.cpp
More file actions
39 lines (32 loc) · 805 Bytes
/
Copy pathhierarchy_skeleton.cpp
File metadata and controls
39 lines (32 loc) · 805 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
37
template<class T> class BaseT;
typedef BaseT<void> Base;
template<class T> class DerivedT;
typedef DerivedT<void> Derived;
template<class T> class BaseT : public Handle
{
public:
BaseT(...) : Handle(create<Body>(...)) { }
void process() { return body()->process(); }
protected:
BaseT(const Handle& other) : Handle(other) { }
class Body : public Handle::Body
{
public:
virtual void process() = 0;
};
private:
Body* body() { return as<Body>(); }
};
template<class T> class DerivedT : public Base
{
public:
DerivedT(...) : Base(create<Body>(...)) { }
DerivedT(const Base& other) : Base(from<Body>) { }
private:
DerivedT(const Handle& other) : Base(other) { }
class Body : public Base::Body
{
public:
void process() { }
};
};