QMCPACK
OhmmsParameter.h File Reference
+ Include dependency graph for OhmmsParameter.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OhmmsParameter< T >
 
class  OhmmsParameter< bool >
 A specialization of OhmmsParameter<T> for T = boolean. More...
 

Enumerations

enum  TagStatus {
  OPTIONAL, REQUIRED, DEPRECATED, DELETED,
  UNSUPPORTED
}
 generic class for parameter xmlNode More...
 

Functions

void checkTagStatus (const std::string &tagname, TagStatus status)
 

Enumeration Type Documentation

◆ TagStatus

enum TagStatus
strong

generic class for parameter xmlNode

<parameter> node is used to generically add a named parameter whose value is the content of an xmlNode. The definition confirms docbook::parameter Usage is: <parameter name="aname" > value </parameter>
Example is: <parameter name="temperature" > 200 </parameter>

  • name is the name of the parameter.
  • value is the content of the parameter of type T.
    Two kinds of template parameter T are valid:
  • intrinsic C/C variables, such as int,double
  • Ohmms basic data types in OhmmsPETE, such as TinyVector<T,D> and Tensor<T,D>
Using other types are valid, as far as the operators << and >> can handle the xmlChar*.

Enumerator
OPTIONAL 
REQUIRED 
DEPRECATED 
DELETED 
UNSUPPORTED 

Definition at line 48 of file OhmmsParameter.h.

49 {
50  OPTIONAL, // there is a default value
51  REQUIRED, // no default value, input required.
52  DEPRECATED, // deprecated input tag. Input becomes optional
53  DELETED, // deleted input tag. Hard stop if detected.
54  UNSUPPORTED // not supported input tags due to incompatible changes. Hard stop if detected.
55 };

Function Documentation

◆ checkTagStatus()

void checkTagStatus ( const std::string &  tagname,
TagStatus  status 
)
inline

Definition at line 57 of file OhmmsParameter.h.

References qmcplusplus::app_warning(), DELETED, DEPRECATED, and UNSUPPORTED.

Referenced by OhmmsParameter< T >::put(), and OhmmsParameter< bool >::put().

58 {
59  if (status == TagStatus::DELETED)
60  {
61  std::ostringstream msg;
62  msg << "Input tag \"" << tagname << "\" has been deleted. Please remove it from the input file!" << std::endl;
63  throw std::runtime_error(msg.str());
64  }
65  else if (status == TagStatus::UNSUPPORTED)
66  {
67  std::ostringstream msg;
68  msg << "Input tag \"" << tagname << "\" is not supported. Please remove it from the input file!" << std::endl;
69  throw std::runtime_error(msg.str());
70  }
71  else if (status == TagStatus::DEPRECATED)
72  qmcplusplus::app_warning() << "Input tag \"" << tagname
73  << "\" has been deprecated and will be deleted in the next release!" << std::endl;
74 }
std::ostream & app_warning()
Definition: OutputManager.h:69