Jpp  15.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JPARSER::JCounter Class Reference

Auxiliary class to handle multiple boolean-like I/O. More...

#include <JParser.hh>

Inheritance diagram for JPARSER::JCounter:
JLANG::JAbstractObjectStatus JLANG::JComparable< JFirst_t, JSecond_t > JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JCounter ()
 Default constructor. More...
 
virtual bool getStatus () const override
 Get status of this counter. More...
 
bool less (const JCounter &value) const
 Compare value. More...
 
bool less (const int value) const
 Compare value. More...
 
bool more (const int value) const
 Compare value. More...
 
int getCounter () const
 Get counter. More...
 
const JCounteroperator= (const bool value)
 Set value. More...
 
 operator bool () const
 Type conversion operator. More...
 
bool operator! () const
 Negated status of this object. More...
 

Protected Attributes

int counter
 

Friends

std::istream & operator>> (std::istream &in, JCounter &object)
 Read option from input. More...
 
std::ostream & operator<< (std::ostream &out, const JCounter &object)
 Write options to output. More...
 

Detailed Description

Auxiliary class to handle multiple boolean-like I/O.

Definition at line 221 of file JParser.hh.

Constructor & Destructor Documentation

JPARSER::JCounter::JCounter ( )
inline

Default constructor.

Definition at line 230 of file JParser.hh.

230  :
231  counter(0)
232  {}

Member Function Documentation

virtual bool JPARSER::JCounter::getStatus ( ) const
inlineoverridevirtual

Get status of this counter.

Returns
true if counter not zero; else false

Implements JLANG::JAbstractObjectStatus.

Definition at line 240 of file JParser.hh.

241  {
242  return (this->counter != 0);
243  }
bool JPARSER::JCounter::less ( const JCounter value) const
inline

Compare value.

Parameters
valuevalue
Returns
true if this counter is less than given value; else false

Definition at line 252 of file JParser.hh.

253  {
254  return this->counter < value.counter;
255  }
bool JPARSER::JCounter::less ( const int  value) const
inline

Compare value.

Parameters
valuevalue
Returns
true if this counter is less than given value; else false

Definition at line 264 of file JParser.hh.

265  {
266  return this->counter < value;
267  }
bool JPARSER::JCounter::more ( const int  value) const
inline

Compare value.

Parameters
valuevalue
Returns
true if this counter is more than given value; else false

Definition at line 276 of file JParser.hh.

277  {
278  return this->counter > value;
279  }
int JPARSER::JCounter::getCounter ( ) const
inline

Get counter.

Returns
counter

Definition at line 287 of file JParser.hh.

288  {
289  return counter;
290  }
const JCounter& JPARSER::JCounter::operator= ( const bool  value)
inline

Set value.

Note that no assignment actually takes place but the internal counter is set to one.

Parameters
valuevalue
Returns
this object

Definition at line 301 of file JParser.hh.

302  {
303  counter = 1;
304 
305  return *this;
306  }
JLANG::JAbstractObjectStatus::operator bool ( ) const
inlineinherited

Type conversion operator.

Returns
status of this object

Definition at line 33 of file JAbstractObjectStatus.hh.

34  {
35  return this->getStatus();
36  }
virtual bool getStatus() const =0
Get status of object.
bool JLANG::JAbstractObjectStatus::operator! ( ) const
inlineinherited

Negated status of this object.

Returns
negated status of this object

Definition at line 44 of file JAbstractObjectStatus.hh.

45  {
46  return !(this->getStatus());
47  }
virtual bool getStatus() const =0
Get status of object.

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JCounter object 
)
friend

Read option from input.

Note that no value actually is read, only the internal counter is incremented.

Parameters
ininput stream
objectoption
Returns
input stream

Definition at line 318 of file JParser.hh.

319  {
320  ++object.counter;
321 
322  return in;
323  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
std::ostream& operator<< ( std::ostream &  out,
const JCounter object 
)
friend

Write options to output.

Parameters
outoutput stream
objectoption
Returns
output stream

Definition at line 333 of file JParser.hh.

334  {
335  out << object.counter;
336 
337  return out;
338  }

Member Data Documentation

int JPARSER::JCounter::counter
protected

Definition at line 341 of file JParser.hh.


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