Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
app_poly1.cpp
Go to the documentation of this file.
1 
9 #include "demos.h"
10 #include "objtracer/demobj.h"
11 #include "tracer/tracer.h"
12 
13 #include <iostream>
14 #include <list>
15 #include <memory>
16 
17 using namespace std;
18 using namespace ODemo;
19 
20 namespace {
21 
22 void display_all(list<shared_ptr<Vehicle>> l)
23 {
25  for (const auto& p : l) {
26  p->info();
27  }
28 }
29 
30 } // namespace
31 
37 int app_poly1()
38 {
40 
41  COMP_MISC_TRACER_OUTPUT_OFF; // Setting the log output ON/OFF
42  list<shared_ptr<Vehicle>> l1{make_shared<RoadVehicle>(), make_shared<RoadVehicle>(),
43  make_shared<PassengerRoadVehicle>(5)};
44 
45  COMP_MISC_TRACER_OUTPUT_ON; // Setting the log output ON/OFF
46  COMP_MISC_LOG_TRACER("invocation for l1:");
47  display_all(l1);
48  COMP_MISC_LOG_TRACER("done with l1.");
49 
50  COMP_MISC_TRACER_OUTPUT_OFF; // Setting the log output ON/OFF
51  list<shared_ptr<Vehicle>> l2{make_shared<RoadVehicle>(), make_shared<Bicycle>("Honda", "black"),
52  make_shared<SailBoat>("Freddy")};
53 
54  COMP_MISC_TRACER_OUTPUT_ON; // Setting the log output ON/OFF
55  COMP_MISC_LOG_TRACER("invocation for l2:");
56  display_all(l2);
57  COMP_MISC_LOG_TRACER("done with l2.");
58 
59  COMP_MISC_LOG_TRACER(">>>> statement: return 0;");
60  return 0;
61 }
Comprehensive include file for all tracer classes.
Header for object tracer demo routines.
int app_poly1()
Demonstrates late binding.
Definition: app_poly1.cpp:37
#define COMP_MISC_FUNCTION_TRACER
Macro for tracking function scope.
#define COMP_MISC_TRACER_OUTPUT_OFF
Macro for turning tracker output off.
Definition: TracerOutput.h:14
#define COMP_MISC_LOG_TRACER(MSG)
Macro for inserting log message into tracker output at current severity level.
Definition: TracerOutput.h:17
#define COMP_MISC_TRACER_OUTPUT_ON
Macro for turning tracker output on.
Definition: TracerOutput.h:11
Comprehensive include file for all of objtracer.