Simpatico  v1.10
Begin.h
1 #ifndef UTIL_BEGIN_H
2 #define UTIL_BEGIN_H
3 
4 /*
5 * Util Package - C++ Utilities for Scientific Computation
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <util/param/ParamComponent.h>
12 #include <util/param/Label.h>
13 
14 #include <string>
15 
16 namespace Util
17 {
18 
24  class Begin : public ParamComponent
25  {
26 
27  public:
28 
32  Begin(const char* label, bool isRequired = true);
33 
34  // Default destructor.
35 
41  virtual void readParam(std::istream &in);
42 
48  virtual void writeParam(std::ostream &out);
49 
53  bool isRequired() const;
54 
58  bool isActive() const;
59 
63  virtual void resetParam();
64 
65  private:
66 
68  Label label_;
69 
71  bool isActive_;
72 
73  };
74 
75  /*
76  * Is this the beginning line for a required element?
77  */
78  inline bool Begin::isRequired() const
79  { return label_.isRequired(); }
80 
81  /*
82  * Is this element active (has it been read from file)?
83  */
84  inline bool Begin::isActive() const
85  { return isActive_; }
86 
87 }
88 #endif
Begin(const char *label, bool isRequired=true)
Constructor.
Definition: Begin.cpp:21
bool isRequired() const
Is this the label for a required component?
Definition: Label.h:197
virtual void resetParam()
Do-nothing implementation of virtual resetParam function.
Definition: Begin.cpp:86
Utility classes for scientific computation.
Definition: accumulators.mod:1
virtual void writeParam(std::ostream &out)
Write the opening line.
Definition: Begin.cpp:80
Abstract base class for classes that input and ouput parameters to file.
A label string in a file format.
Definition: Label.h:36
bool isRequired() const
Is this the beginning line for a required element?
Definition: Begin.h:78
bool isActive() const
Is this an active element (has it been read from file)?
Definition: Begin.h:84
virtual void readParam(std::istream &in)
Read the opening line.
Definition: Begin.cpp:33
Beginning line of a composite parameter block.
Definition: Begin.h:24