QMCPACK
AnotherInput Class Reference

Generic delgate input class. More...

+ Collaboration diagram for AnotherInput:

Classes

class  AnotherInputSection
 

Public Member Functions

 AnotherInput (xmlNodePtr cur)
 
std::vector< std::string_view > getTokens () const
 
const std::string & get_name () const
 

Private Attributes

std::string name_ = "AnotherInputSection"
 
AnotherInputSection input_section_
 
std::string input_str_
 
std::string optional_
 
std::vector< std::string_view > tokens_
 

Detailed Description

Generic delgate input class.

This feature is targeted at supporting things like ReferencePointsInput, SpaceGridInput etc.

The delegate input requires: A constructor that takes an xmlNodePtr A factoryFunction that matches the signature discussed in InputSection::DelegateHandler

Definition at line 516 of file test_InputSection.cpp.

Constructor & Destructor Documentation

◆ AnotherInput()

AnotherInput ( xmlNodePtr  cur)
inline

Definition at line 531 of file test_InputSection.cpp.

References LAMBDA_setIfInInput.

532  {
533  input_section_.readXML(cur);
534  auto setIfInInput = LAMBDA_setIfInInput;
535  setIfInInput(name_, "name");
536  setIfInInput(optional_, "optional");
537  input_str_ = XMLNodeString{cur};
538  }
#define LAMBDA_setIfInInput
If tag is present in input_secution set its variable.
void readXML(xmlNodePtr cur)
Read variable values (initialize) from XML input, call checkValid.
convert xmlNode contents into a std::string
AnotherInputSection input_section_

Member Function Documentation

◆ get_name()

const std::string& get_name ( ) const
inline

Definition at line 541 of file test_InputSection.cpp.

Referenced by qmcplusplus::makeAnotherInput().

541 { return name_; };

◆ getTokens()

std::vector<std::string_view> getTokens ( ) const
inline

Definition at line 540 of file test_InputSection.cpp.

References qmcplusplus::modernstrutil::split().

540 { return modernstrutil::split(input_str_, " "); }
std::vector< std::string_view > split(const string_view s, const string_view delimiters)

Member Data Documentation

◆ input_section_

AnotherInputSection input_section_
private

Definition at line 545 of file test_InputSection.cpp.

◆ input_str_

std::string input_str_
private

Definition at line 546 of file test_InputSection.cpp.

◆ name_

std::string name_ = "AnotherInputSection"
private

Definition at line 544 of file test_InputSection.cpp.

◆ optional_

std::string optional_
private

Definition at line 547 of file test_InputSection.cpp.

◆ tokens_

std::vector<std::string_view> tokens_
private

Definition at line 548 of file test_InputSection.cpp.


The documentation for this class was generated from the following file: