Jpp
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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< bool > JPARSER::JParserTemplateElement< JCounter > JPARSER::JParserTemplateElement< JType_t, false > JPARSER::JParserTemplateElement< JType_t, true >

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::string __name
 
std::string __help
 

Detailed Description

Interface for I/O of parser element.

Definition at line 345 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 356 of file JParser.hh.

357  :
358  __name(name),
359  __help(help)
360  {}

Member Function Documentation

◆ getName()

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

Get name of parameter.

Returns
name

Definition at line 369 of file JParser.hh.

370  {
371  return __name;
372  }

◆ getHelp()

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

Get help of parameter.

Returns
help

Definition at line 380 of file JParser.hh.

381  {
382  return __help;
383  }

◆ 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< JCounter >, JPARSER::JParserTemplateElement< bool >, and JPARSER::JParserTemplateElement< JType_t, false >.

◆ print()

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

Print.

Parameters
outoutput stream
Returns
output stream

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

Definition at line 416 of file JParser.hh.

417  {
418  using namespace std;
419 
420  out << "<" << getName() << ">";
421 
422  if (getStatus() && !getShortprint(out)) {
423 
424  int width = WIDTH - getName().length();
425 
426  if (width > 0) {
427  out << setw(width) << " ";
428  }
429 
430  out << " = ";
431 
432  write(out);
433  }
434 
435  if (getLongprint(out) && getHelp() != "") {
436  out << " \"" << getHelp() << "\"";
437  }
438  }

◆ 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< JCounter >, and JPARSER::JParserTemplateElement< bool >.

Definition at line 446 of file JParser.hh.

447  {
448  return true;
449  }

◆ read()

virtual std::istream& JLANG::JStreamInput::read ( std::istream &  in)
pure virtualinherited

◆ write()

virtual std::ostream& JLANG::JStreamOutput::write ( std::ostream &  out) const
pure virtualinherited

Member Data Documentation

◆ __name

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

Definition at line 453 of file JParser.hh.

◆ __help

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

Definition at line 454 of file JParser.hh.


The documentation for this class was generated from the following file:
JPARSER::JParserElementInterface::getHelp
const std::string & getHelp() const
Get help of parameter.
Definition: JParser.hh:380
JPARSER::JParserElementInterface::getName
const std::string & getName() const
Get name of parameter.
Definition: JParser.hh:369
JPARSER::JParserElementInterface::getStatus
virtual bool getStatus() const =0
Get status of parameter.
getLongprint
bool getLongprint(std::ostream &out)
Get long print option.
Definition: JPrint.hh:157
WIDTH
Auxiliary data structure for alignment of data.
Definition: JPrint.hh:267
JPARSER::JParserElementInterface::__name
std::string __name
Definition: JParser.hh:453
std
Definition: jaanetDictionary.h:36
JLANG::JStreamOutput::write
virtual std::ostream & write(std::ostream &out) const =0
Stream output.
getShortprint
bool getShortprint(std::ostream &out)
Get short print option.
Definition: JPrint.hh:111
JPARSER::JParserElementInterface::__help
std::string __help
Definition: JParser.hh:454