Simpatico  v1.10
End.cpp
1 /*
2 * Util Package - C++ Utilities for Scientific Computation
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "End.h"
9 #include <util/global.h>
10 
11 namespace Util
12 {
13 
14  /*
15  * Constructor.
16  */
18  : label_("}")
19  {}
20 
21  /*
22  * Destructor.
23  */
25  {}
26 
27  /*
28  * Read and check end bracket.
29  */
30  void End::readParam(std::istream &in)
31  {
32  if (isIoProcessor()) {
33  in >> label_;
34  if (ParamComponent::echo()) {
36  }
37  }
38  }
39 
40  /*
41  * End::writeParam()
42  */
43  void End::writeParam(std::ostream &out)
44  { out << indent() << "}" << std::endl; }
45 
46  /*
47  * Empty implementation of virtual resetParam() method.
48  */
50  {}
51 
52 }
File containing preprocessor macros for error handling.
virtual ~End()
Destructor.
Definition: End.cpp:24
Utility classes for scientific computation.
Definition: accumulators.mod:1
static bool echo()
Get echo parameter.
bool isIoProcessor() const
Can this processor do file I/O ?
Definition: MpiFileIo.h:92
End()
Constructor.
Definition: End.cpp:17
virtual void writeParam(std::ostream &out)
Write the closing bracket.
Definition: End.cpp:43
static std::ostream & file()
Get log ostream by reference.
Definition: Log.cpp:57
virtual void readParam(std::istream &in)
Read the closing bracket.
Definition: End.cpp:30
void resetParam()
Do-nothing implementation of virtual resetParam function.
Definition: End.cpp:49
std::string indent() const
Return indent string for this object (string of spaces).