Scarab  v2.4.8
Project 8 C++ Utility Library
test_param_by_pointer.cc
Go to the documentation of this file.
1 /*
2  * test_param_by_pointer.cc
3  *
4  * Created on: Jul 18, 2018
5  * Author: N.S. Oblath
6  *
7  * Output should be something like:
8 2018-07-18 10:57:26 [ INFO] (tid 0x7fff9c9dc380) am_by_pointer.cc(18): Building node
9 2018-07-18 10:57:26 [ INFO] (tid 0x7fff9c9dc380) am_by_pointer.cc(34):
10 {
11  eight : 8.000000
12  subarray :
13  [
14  80
15  800
16  ]
17 
18 }
19  *
20  */
21 
22 #include "param.hh"
23 
24 #include "logger.hh"
25 
26 LOGGER( testlog, "test_param_by_pointer" )
27 
28 using namespace scarab;
29 
30 int main()
31 {
32  LINFO( testlog, "Building node" );
33  param_ptr_t param_0( new param_node() );
34 
35  param_ptr_t param_1( new param_value(8.0) );
36  param_0->as_node().add( "eight", std::move(param_1) );
37 
38  param_ptr_t param_2( new param_array() );
39 
40  param_ptr_t param_3( new param_value(80) );
41  param_2->as_array().push_back( std::move(param_3) );
42 
43  param_ptr_t param_4( new param_value(800) );
44  param_2->as_array().push_back( std::move(param_4) );
45 
46  param_0->as_node().add( "subarray", std::move(param_2) );
47 
48  LINFO( testlog, *param_0 );
49 
50  return 0;
51 }
52 
53 
54 
#define LOGGER(I, K)
Definition: logger.hh:355
Contains the logger class and macros, based on Kasper's KLogger class.
#define LINFO(...)
Definition: logger.hh:367
std::unique_ptr< param > param_ptr_t
Definition: param_base.hh:23
int main()