Om
taker.cpp
Go to the documentation of this file.
1 
15 #ifndef Om_Taker_
16 
17  #include "om/taker.hpp"
18 
19 #else
20 
21 // MARK: - Om::Taker
22 
23  #define Template_ \
24  template <typename ThisImplementation>
25 
26  #define Type_ \
27  Om::Taker<ThisImplementation>
28 
29 // MARK: public (non-static)
30 
31 Template_
32 inline Type_::~Taker() {}
33 
34 Template_
35 inline void Type_::Take(ThisImplementation & theTaker) {
36  assert(
37  dynamic_cast<ThisImplementation *>(this)
38  );
39  static_cast<ThisImplementation &>(*this).Swap(theTaker);
40 }
41 
42 Template_
43 inline void Type_::Take(ThisImplementation const & theTaker) {
44  assert(
45  dynamic_cast<ThisImplementation *>(this)
46  );
47  static_cast<ThisImplementation &>(*this) = theTaker;
48 }
49 
50  #undef Type_
51  #undef Template_
52 
53 #endif
Om header file.