Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
Body.cpp
Go to the documentation of this file.
1 
7 #include "Body.h"
8 #include "tracer/tracer.h"
9 #include <iostream>
10 
11 namespace ODemo {
12 using namespace std;
13 
14 Body::Body(std::string color) : m_color(std::move(color)) { COMP_MISC_MEMBER_TRACER; }
15 
16 Body::Body(Body const& ori) : m_color(ori.m_color) { COMP_MISC_MEMBER_TRACER; }
17 
18 Body::Body(Body&& ori) noexcept : m_color(std::move(ori.m_color)) { COMP_MISC_MEMBER_TRACER; }
19 
21 {
23  if (this != &rhs) {
24  m_color = rhs.m_color;
25  }
26  return *this;
27 }
28 
29 Body& Body::operator=(Body&& rhs) noexcept
30 {
32  if (this != &rhs) {
33  m_color = std::move(rhs.m_color);
34  rhs.m_color = nullptr;
35  }
36  return *this;
37 }
38 
40 
42 {
44  return Body(m_color + b.m_color);
45 }
46 } // namespace ODemo
Comprehensive include file for all tracer classes.
Body & operator=(Body const &rhs)
Copy assingment.
Definition: Body.cpp:20
Header for Bicycle class.
Body(std::string color="blue")
Constructor.
Definition: Body.cpp:14
~Body()
Destructor.
Definition: Body.cpp:39
#define COMP_MISC_MEMBER_TRACER
Macro for tracking member scope.
Definition: MemberTracer.h:21
Body operator+(const Body &b)
Weird operation.
Definition: Body.cpp:41
std::string m_color
Definition: Body.h:39