Sierra Toolkit  Version of the Day
stk_classic::diag::OptionMaskParser Class Reference

#include <Option.hpp>

Inheritance diagram for stk_classic::diag::OptionMaskParser:
Collaboration diagram for stk_classic::diag::OptionMaskParser:

Public Types

typedef OptionMask Mask
 Mask for this option.
 

Public Member Functions

 OptionMaskParser ()
 
virtual ~OptionMaskParser ()
 
const OptionMaskNameMapgetOptionMaskNameMap () const
 
virtual Mask parse (const char *mask) const
 
virtual void parseArg (const std::string &name, const std::string &arg) const
 
Maskoperator[] (const std::string &name)
 
void mask (const std::string &name, const Mask l_mask, const std::string &description)
 
std::ostream & describe (std::ostream &os) const
 
- Public Member Functions inherited from stk_classic::diag::OptionDescription
virtual ~OptionDescription ()
 

Protected Attributes

OptionMaskNameMap m_optionMaskNameMap
 Mask name vector.
 
OptionMask m_optionMask
 Most recently parsed mask.
 
bool m_status
 Result of most recent parse.
 

Detailed Description

Class OptionMaskParser defines a mapping between strings and bit masks and output streams.

After populating a Parser object, parse() will parse the input string. The getMask() and virtual getOutputStream() functions will return the print parsed print mask and the selected output stream.

Definition at line 258 of file Option.hpp.

Constructor & Destructor Documentation

◆ OptionMaskParser()

stk_classic::diag::OptionMaskParser::OptionMaskParser ( )
inline

Creates a new OptionMaskParser instance.

Definition at line 268 of file Option.hpp.

◆ ~OptionMaskParser()

virtual stk_classic::diag::OptionMaskParser::~OptionMaskParser ( )
inlinevirtual

Destroys a OptionMaskParser instance.

Definition at line 278 of file Option.hpp.

Member Function Documentation

◆ parse()

OptionMaskParser::Mask stk_classic::diag::OptionMaskParser::parse ( const char *  mask) const
virtual

Member function parse parses the string

Parameters
maska char const pointer of the string to parse.
Returns
a Mask value of the parsed bitmask.

Reimplemented in sierra::Diag::TimerParser, and stk_classic::diag::WriterParser.

Definition at line 15 of file Option.cpp.

◆ parseArg()

void stk_classic::diag::OptionMaskParser::parseArg ( const std::string &  name,
const std::string &  arg 
) const
virtual

Member function parseArg parses the argument and its argument values.

Parameters
namea std::string const reference to the argument name.
arga std::string const reference to the argument values.

Reimplemented in sierra::Diag::TimerParser, and stk_classic::diag::WriterParser.

Definition at line 93 of file Option.cpp.

◆ operator[]()

Mask& stk_classic::diag::OptionMaskParser::operator[] ( const std::string &  name)
inline

Member function operator[] returns the print mask with the specified name. If the name is not found, a new entry is added.

Parameters
namea std::string const reference of the name of the mask.
Returns
a Mask reference of the print mask associated with the print mask name.

Definition at line 315 of file Option.hpp.

◆ mask()

void stk_classic::diag::OptionMaskParser::mask ( const std::string &  name,
const Mask  l_mask,
const std::string &  description 
)
inline

Member function mask adds a named mask to the parser. The mask can also be given a description which is displayed using the describe() function.

Parameters
namea std::string const reference of the name of the mask.
maska Mask value to associate with the name
descriptiona std::string const reference which describes the mask.

Definition at line 332 of file Option.hpp.

◆ describe()

std::ostream & stk_classic::diag::OptionMaskParser::describe ( std::ostream &  os) const
virtual

Member function describe ...

Parameters
osa std::ostream variable ...
Returns
a std::ostream ...

Implements stk_classic::diag::OptionDescription.

Definition at line 112 of file Option.cpp.


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