Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
app_fcalls.cpp
Go to the documentation of this file.
1 
7 #include "demos.h"
8 #include "objtracer/Motorcycle.h"
9 #include "tracer/tracer.h"
10 
11 using namespace std;
12 using namespace ODemo;
13 
14 namespace {
15 void f1(Motorcycle b)
16 {
18  b.halt();
19  b.getSpeed();
20 }
21 void f2(Motorcycle& b)
22 {
24  b.halt();
25 }
26 void f2p(Motorcycle* bp)
27 {
29  bp->halt();
30 }
31 void f3(const Motorcycle& b)
32 {
34  b.is_running();
35 }
36 void f3p(const Motorcycle* bp)
37 {
39  bp->is_running();
40 }
41 Motorcycle g() { return Motorcycle(); }
42 } // namespace
43 
51 {
53 
54  COMP_MISC_LOG_TRACER(" statement: Motorcycle bvar1(shared_ptr<Engine>(new Engine(1.0)));");
55  Motorcycle bvar1(make_shared<Engine>(1.0));
56 
57  COMP_MISC_LOG_TRACER(" statement: f1(bvar1);");
58  f1(bvar1);
59 
60  COMP_MISC_LOG_TRACER(" statement: f2(bvar1);");
61  f2(bvar1);
62 
63  COMP_MISC_LOG_TRACER(" statement: f2p(&bvar1);");
64  f2p(&bvar1);
65 
66  COMP_MISC_LOG_TRACER(" statement: f3(bvar1);");
67  f3(bvar1);
68 
69  COMP_MISC_LOG_TRACER(" statement: f3p(&bvar1);");
70  f3p(&bvar1);
71 
72  COMP_MISC_LOG_TRACER(" statement: g();");
73  Motorcycle m;
74  m = g();
75 
76  COMP_MISC_LOG_TRACER(" statement: return 0;");
77  return 0;
78 }
Comprehensive include file for all tracer classes.
Header for object tracer demo routines.
double getSpeed() const
Return current speed.
Definition: Motorcycle.cpp:167
Motorcycle with Engine and Owner.
Definition: Motorcycle.h:20
#define COMP_MISC_FUNCTION_TRACER
Macro for tracking function scope.
void halt()
Brake to zero speed, keep engine running.
Definition: Motorcycle.cpp:153
bool is_running() const
Indicates whether engine is running or not.
Definition: Motorcycle.cpp:173
Header for the Motorcycle class.
int app_fcalls()
Demo prog for features of essential ops.
Definition: app_fcalls.cpp:50
#define COMP_MISC_LOG_TRACER(MSG)
Macro for inserting log message into tracker output at current severity level.
Definition: TracerOutput.h:17