~nrtb-core/nrtb/alpha

« back to all changes in this revision

Viewing changes to cpp/sim_engine/main/simengine.cpp

  • Committer: Rick Stovall
  • Date: 2013-11-16 21:09:50 UTC
  • mfrom: (15.1.16 ricks-sprint-003)
  • Revision ID: rick_stovall_fpstovall-20131116210950-riiyz7lv1njccv96
Merging sprint-003. some refactoring, a couple bug fixes, and the interthread communications modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***********************************************
 
2
 This file is part of the NRTB project (https://*launchpad.net/nrtb).
 
3
 
 
4
 NRTB is free software: you can redistribute it and/or modify
 
5
 it under the terms of the GNU General Public License as published by
 
6
 the Free Software Foundation, either version 3 of the License, or
 
7
 (at your option) any later version.
 
8
 
 
9
 NRTB is distributed in the hope that it will be useful,
 
10
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 GNU General Public License for more details.
 
13
 
 
14
 You should have received a copy of the GNU General Public License
 
15
 along with NRTB.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
 **********************************************/
 
18
 
 
19
#include <common.h>
 
20
#include <logger.h>
 
21
#include <confreader.h>
 
22
 
 
23
using namespace nrtb;
 
24
using namespace std;
 
25
 
 
26
int main(int argc, char * argv[])
 
27
{
 
28
  // load the global configuration
 
29
  conf_reader config;
 
30
  config.read(argc, argv, "simengine.conf");
 
31
  
 
32
  // start the system logger
 
33
  log_queue g_log_queue;
 
34
  log_file_writer g_log_writer(g_log_queue,
 
35
        config.get<string>("global_log_file","simengine.log"));
 
36
  // create our recorder
 
37
  log_recorder g_log("main",g_log_queue);
 
38
  
 
39
  // Report our startup and configuration.
 
40
  g_log.info("Start up");
 
41
  g_log.info("Configuration Follows");
 
42
  for (auto i : config)
 
43
  {
 
44
    g_log.info(i.first+" = "+i.second);
 
45
  };
 
46
  g_log.info("Configuration list complete");
 
47
  
 
48
  // Any modules called from here should be passed the 
 
49
  // g_log_queue and config by reference. 
 
50
  
 
51
  
 
52
  // say goodbye
 
53
  g_log.info("Shut down");
 
54
};
 
55
 
 
56
 
 
57
 
 
58
 
 
59
 
 
60
 
 
61
 
 
62
 
 
63
 
 
64
 
 
65
 
 
66
 
 
67
 
 
68
 
 
69
 
 
70
 
 
71
 
 
72
 
 
73
 
 
74
 
 
75
 
 
76
 
 
77
 
 
78
 
 
79
 
 
80
 
 
81