Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JPARSER::JParserElementInterface Class Referenceabstract

Interface for I/O of parser element. More...

#include <JParser.hh>

Inheritance diagram for JPARSER::JParserElementInterface:
JLANG::JStreamInput JLANG::JStreamOutput JPARSER::JParserTemplateElement< JCounter > JPARSER::JParserTemplateElement< JType_t, false > JPARSER::JParserTemplateElement< bool > JPARSER::JParserTemplateElement< JType_t, true >

Public Member Functions

const std::string & getName () const
 Get name of parameter.
 
const std::string & getHelp () const
 Get help of parameter.
 
virtual bool getStatus () const =0
 Get status of parameter.
 
virtual bool getInitialisationStatus () const =0
 Get initialisation status of parameter.
 
virtual void setInitialiationStatus (const bool value)=0
 Set initialisation status of parameter.
 
virtual void print (std::ostream &out) const
 Print.
 
virtual bool gcount () const
 Read counter.
 
virtual std::istream & read (std::istream &in)=0
 Stream input.
 
virtual std::ostream & write (std::ostream &out) const =0
 Stream output.
 

Protected Member Functions

 JParserElementInterface (const std::string &name="arg", const std::string &help="")
 Constructor.
 

Protected Attributes

std::string __name
 
std::string __help
 

Detailed Description

Interface for I/O of parser element.

Definition at line 545 of file JParser.hh.

Constructor & Destructor Documentation

◆ JParserElementInterface()

JPARSER::JParserElementInterface::JParserElementInterface ( const std::string & name = "arg",
const std::string & help = "" )
inlineprotected

Constructor.

Parameters
namename of object
helphelp of object

Definition at line 556 of file JParser.hh.

557 :
558 __name(name),
559 __help(help)
560 {}

Member Function Documentation

◆ getName()

const std::string & JPARSER::JParserElementInterface::getName ( ) const
inline

Get name of parameter.

Returns
name

Definition at line 569 of file JParser.hh.

570 {
571 return __name;
572 }

◆ getHelp()

const std::string & JPARSER::JParserElementInterface::getHelp ( ) const
inline

Get help of parameter.

Returns
help

Definition at line 580 of file JParser.hh.

581 {
582 return __help;
583 }

◆ getStatus()

virtual bool JPARSER::JParserElementInterface::getStatus ( ) const
pure virtual

◆ getInitialisationStatus()

virtual bool JPARSER::JParserElementInterface::getInitialisationStatus ( ) const
pure virtual

◆ setInitialiationStatus()

virtual void JPARSER::JParserElementInterface::setInitialiationStatus ( const bool value)
pure virtual

Set initialisation status of parameter.

Parameters
valueinitialisation status

Implemented in JPARSER::JParserTemplateElement< bool >, JPARSER::JParserTemplateElement< JCounter >, and JPARSER::JParserTemplateElement< JType_t, false >.

◆ print()

virtual void JPARSER::JParserElementInterface::print ( std::ostream & out) const
inlinevirtual

Print.

Parameters
outoutput stream

Reimplemented in JPARSER::JParserTemplateElement< JType_t, true >.

Definition at line 615 of file JParser.hh.

616 {
617 using namespace std;
618
619 out << "<" << getName() << ">";
620
621 if (getStatus() && !getShortprint(out)) {
622
623 int width = WIDTH - getName().length();
624
625 if (width > 0) {
626 out << setw(width) << " ";
627 }
628
629 out << " = ";
630
631 write(out);
632 }
633
634 if (getLongprint(out) && getHelp() != "") {
635 out << " \"" << getHelp() << "\"";
636 }
637 }
bool getShortprint(std::ostream &out)
Get short print option.
Definition JManip.hh:75
bool getLongprint(std::ostream &out)
Get long print option.
Definition JManip.hh:121
virtual std::ostream & write(std::ostream &out) const =0
Stream output.
virtual bool getStatus() const =0
Get status of parameter.
const std::string & getName() const
Get name of parameter.
Definition JParser.hh:569
const std::string & getHelp() const
Get help of parameter.
Definition JParser.hh:580
Auxiliary data structure for alignment of data.
Definition JManip.hh:231

◆ gcount()

virtual bool JPARSER::JParserElementInterface::gcount ( ) const
inlinevirtual

Read counter.

Returns
true if at least one character to be read; else false

Reimplemented in JPARSER::JParserTemplateElement< bool >, and JPARSER::JParserTemplateElement< JCounter >.

Definition at line 645 of file JParser.hh.

646 {
647 return true;
648 }

◆ read()

◆ write()

Member Data Documentation

◆ __name

std::string JPARSER::JParserElementInterface::__name
protected

Definition at line 652 of file JParser.hh.

◆ __help

std::string JPARSER::JParserElementInterface::__help
protected

Definition at line 653 of file JParser.hh.


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