gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
coutprinter.cpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
16 
17 
18 // Standard libraries
19 #include <map>
20 #include <vector>
21 #include <algorithm>
22 #include <ios>
23 #include <sstream>
24 #include <fstream>
25 #include <iomanip>
26 
27 // Gambit
32 
33 // Code!
34 namespace Gambit
35 {
36 
37  namespace Printers
38  {
39 
40  // Constructor
41  coutPrinter::coutPrinter(const Options& options, BasePrinter* const primary)
42  : BasePrinter(primary,options.getValueOrDef<bool>(false,"auxilliary"))
43  {
44  // This printer requires no setup
45  }
46 
48  // Run by dependency resolver, which supplies the functors with a vector of VertexIDs whose requiresPrinting flags are set to true.
49  void coutPrinter::initialise(const std::vector<int>& /*printmevec*/)
50  {
51  }
52 
54  void coutPrinter::finalise(bool /*abnormal*/)
55  {
56  }
57 
59  void coutPrinter::reset(bool)
60  {
61  // Nothing actually stored by this printer so no need for this to do anything
62  }
63 
65  void coutPrinter::check_point(unsigned int mpirank, unsigned long pointID)
66  {
67  // Actually I think it is just good enough to pre-pend the
68  // line with the point information
69  std::cout << mpirank << ", " << pointID << ": "; // No endline
70  }
71 
74  {
75  std::ostringstream err;
76  err << "The cout printer is intrinsically incapable of reading from previous output, since the previous output just goes to cout. So you cannot use the 'resume_reader_options' function with this printer. This means that the coutPrinter cannot be used with e.g. the postprocessor v2 whilst also resuming. Sorry! (Note, postprocessor v1 should be able to resume with the coutPrinter)" << std::endl;
77  printer_error().raise(LOCAL_INFO, err.str());
78  return Options();
79  }
80 
81  } // end namespace printers
82 } // end namespace Gambit
Define overloadings of the stream operator for various containers.
coutPrinter(const Options &, BasePrinter *const primary=NULL)
Constructor (for construction via inifile options)
Definition: coutprinter.cpp:41
EXPORT_SYMBOLS error & printer_error()
Printer errors.
void reset(bool force=false)
Reset printer and output to clean state.
Definition: coutprinter.cpp:59
#define LOCAL_INFO
Definition: local_info.hpp:34
General small utility functions.
"cout" printer class declaration
void check_point(unsigned int mpirank, unsigned long pointID)
coutPrinter specific functions
Definition: coutprinter.cpp:65
Options resume_reader_options()
Permanently unavailable for this printer.
Definition: coutprinter.cpp:73
Exception objects required for standalone compilation.
void initialise(const std::vector< int > &)
Virtual function overloads:
Definition: coutprinter.cpp:49
void finalise(bool abnormal=false)
Do final buffer dumps.
Definition: coutprinter.cpp:54
TODO: see if we can use this one:
Definition: Analysis.hpp:33
A small wrapper object for &#39;options&#39; nodes.