SIMLIB/C++  3.07
output1.cc
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////////
2 //! \file output1.cc Output subsystem implementation
3 //
4 // Copyright (c) 1991-2004 Petr Peringer
5 //
6 // This library is licensed under GNU Library GPL. See the file COPYING.
7 //
8 
9 //
10 // Output methods for all continuous-part classes
11 //#error Split into parts!!!!
12 //
13 
14 ////////////////////////////////////////////////////////////////////////////
15 // interface
16 //
17 
18 #include "simlib.h"
19 #include "internal.h"
20 
21 #include <cstdio> // sprintf()
22 
23 
24 ////////////////////////////////////////////////////////////////////////////
25 // implementation
26 //
27 
28 namespace simlib3 {
29 
31 
32 ////////////////////////////////////////////////////////////////////////////
33 // Event::Output
34 //
35 void Event::Output() const
36 {
37  Print(" EVENT %-48s \n", Name().c_str());
38 }
39 
40 
41 ////////////////////////////////////////////////////////////////////////////
42 // List::Output
43 //
44 void List::Output() const
45 {
46  Print("+----------------------------------------------------------+\n");
47  Print("| LIST %-51s |\n", Name().c_str());
48  Print("+----------------------------------------------------------+\n");
49 #ifdef XXX_PRINT_LIST_
50  {
51  Print("Contents:\n");
52  unsigned u;
53  iterator p;
54  for (p = begin(), u = 1; p != end(); ++p, u++) {
55  Print(" [%u]:\t", u);
56  (*p)->Output();
57  }
58  Print("End of list.\n");
59  }
60 #endif
61 }
62 
64 {
65  Print("#\n");
66  Print("# SIMLIB run-time statistics:\n");
67  Print("# StartTime = %g\n", StartTime);
68  Print("# EndTime = %g\n", EndTime);
69  Print("# EventCount = %ld\n", EventCount);
70  Print("# StepCount = %ld\n", StepCount);
71  if (StepCount>0) {
72  Print("# MinStep = %g\n", MinStep);
73  Print("# MaxStep = %g\n", MaxStep);
74  }
75  Print("#\n");
76 }
77 
78 } // namespace
79 
virtual void Output() const override
print object to default output
Definition: output1.cc:44
virtual std::string Name() const override
name of object
Definition: event.cc:71
void Output() const
print run-time statistics to output
Definition: output1.cc:63
int Print(const char *fmt,...)
for Output methods, can be redirected
Definition: print.cc:92
Implementation of class CalendarList interface is static - using global functions in SQS namespace...
Definition: algloop.cc:32
const double & EndTime
time of simulation end
Definition: run.cc:50
Internal header file for SIMLIB/C++.
Main SIMLIB/C++ interface.
virtual void Output() const override
print object to default output
Definition: output1.cc:35
SIMLIB_IMPLEMENTATION
Definition: algloop.cc:34
const double & MinStep
minimal integration step
Definition: intg.cc:46
const double & MaxStep
maximal integration step
Definition: intg.cc:47
const double & StartTime
time of simulation start
Definition: run.cc:47