TwiceAsNice  2019-02-18
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Nice::Completion Class Reference

Completion with a exception stack. Contains a state (OK, WARNING, ERROR,...), a time stamp that is updated if states change, a percentage, a stack of messages for a logger. More...

#include <Completion.h>

Inheritance diagram for Nice::Completion:
Inheritance graph
Collaboration diagram for Nice::Completion:
Collaboration graph

Public Member Functions

 Completion ()
 default ctor. Sets percentage to zero, timestamp to now, command and action to empty. More...
 
 Completion (const Nice::CompletionVar &_v)
 copy ctor. More...
 
Nice::Completionstart (const std::string &_action="")
 
Nice::CompletionsetDone ()
 
Nice::CompletionsetStop ()
 
Nice::CompletionsetAbort (const Nice::LoggerObject &_o=Nice::LoggerObject())
 
Nice::CompletionsetWarning (const Nice::LoggerObject &_o)
 
Nice::CompletionsetWarning (const std::string &_log)
 
Nice::CompletionsetError (const Nice::Exception &_e)
 
Nice::CompletionsetError (const Nice::LoggerObject &_o, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetError (const Nice::SeqLoggerObject &_oo, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetError (const std::string &_log, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetFatal (const Nice::Exception &_e)
 
Nice::CompletionsetFatal (const Nice::LoggerObject &_o, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetFatal (const Nice::SeqLoggerObject &_oo, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetFatal (const std::string &_log, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionState state () const
 
const Nice::SeqLoggerObjectstack () const
 
template<typename Type >
Type command () const
 
template<typename Type >
Nice::CompletionsetCommand (Type _cmd)
 
Nice::Date timestamp () const
 
Nice::I64 id () const
 
Nice::CompletionsetException (const Nice::Exception &_ex)
 
Nice::CompletionsetException (const std::string &_ex)
 
const std::string & exceptionString () const
 
bool isOK () const
 compare state with OK More...
 
bool isDone () const
 compare state with OK This comparing the state with OK and other error states. More...
 
bool isValid () const
 
bool isDone (const Nice::CompletionVar &_v1) const
 
Nice::Completionoperator+= (Nice::Int)
 
Nice::Completionoperator= (const Nice::CompletionVar &)
 Copy ctor. More...
 
bool operator== (const Nice::Completion &) const
 compare time stamps and Id More...
 
bool operator!= (const Nice::Completion &) const
 compare time stamps and Id More...
 
bool operator< (const Nice::Completion &) const
 compare time stamps More...
 
const std::string & action () const
 
double percent () const
 
Nice::CompletionsetPercent (Nice::Int _v)
 
Nice::CompletionsetAction (Nice::Int _v, const std::string &_action)
 
const Nice::CompletiongetCompletion () const
 
Nice::CompletiongetCompletion ()
 
void setCompletion (const Nice::Completion &_c)
 
 Completion ()
 
 Completion (const Nice::CompletionVar &_v)
 
Nice::Completionstart (const std::string &_action="")
 
Nice::CompletionsetDone ()
 
Nice::CompletionsetStop ()
 
Nice::CompletionsetAbort (const Nice::LoggerObject &_o=Nice::LoggerObject())
 
Nice::CompletionsetWarning (const Nice::LoggerObject &_o)
 
Nice::CompletionsetWarning (const std::string &_log)
 
Nice::CompletionsetError (const Nice::Exception &_e)
 
Nice::CompletionsetError (const Nice::LoggerObject &_o, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetError (const Nice::SeqLoggerObject &_oo, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetError (const std::string &_log, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetFatal (const Nice::Exception &_e)
 
Nice::CompletionsetFatal (const Nice::LoggerObject &_o, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetFatal (const Nice::SeqLoggerObject &_oo, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionsetFatal (const std::string &_log, const Nice::Exception &_e=Nice::Exception())
 
Nice::CompletionState state () const
 
const Nice::SeqLoggerObjectstack () const
 
template<typename Type >
Type command () const
 
template<typename Type >
Nice::CompletionsetCommand (Type _cmd)
 
Nice::Date timestamp () const
 
Nice::I64 id () const
 
Nice::CompletionsetException (const Nice::Exception &_ex)
 
Nice::CompletionsetException (const std::string &_ex)
 
const std::string & exceptionString () const
 
bool isOK () const
 
bool isDone () const
 
bool isValid () const
 
bool isDone (const Nice::CompletionVar &_v1) const
 
Nice::Completionoperator+= (Nice::Int)
 
Nice::Completionoperator= (const Nice::CompletionVar &)
 
bool operator== (const Nice::Completion &) const
 
bool operator!= (const Nice::Completion &) const
 
bool operator< (const Nice::Completion &) const
 
const std::string & action () const
 
double percent () const
 
Nice::CompletionsetPercent (Nice::Int _v)
 
Nice::CompletionsetAction (Nice::Int _v, const std::string &_action)
 
const Nice::CompletiongetCompletion () const
 
Nice::CompletiongetCompletion ()
 
void setCompletion (const Nice::Completion &_c)
 
- Public Member Functions inherited from Nice::CompletionVar
bool operator== (const CompletionVar &__rhs) const
 
bool operator< (const CompletionVar &__rhs) const
 
bool operator!= (const CompletionVar &__rhs) const
 
bool operator<= (const CompletionVar &__rhs) const
 
bool operator> (const CompletionVar &__rhs) const
 
bool operator>= (const CompletionVar &__rhs) const
 
bool operator== (const CompletionVar &__rhs) const
 
bool operator< (const CompletionVar &__rhs) const
 
bool operator!= (const CompletionVar &__rhs) const
 
bool operator<= (const CompletionVar &__rhs) const
 
bool operator> (const CompletionVar &__rhs) const
 
bool operator>= (const CompletionVar &__rhs) const
 

Static Public Member Functions

static Nice::Completion exec ()
 create a completion with EXEC state. Command set to 0 and time stamp to now. More...
 
template<typename Type >
static Nice::Completion exec (Type _cmd)
 
static Nice::Completion stop ()
 create a completion with STOP state. Set time stamp to now. More...
 
static Nice::Completion abort ()
 create a completion in ABORT state. Set time stamp to now. More...
 
static Nice::Completion exec ()
 
template<typename Type >
static Nice::Completion exec (Type _cmd)
 
static Nice::Completion stop ()
 
static Nice::Completion abort ()
 

Protected Member Functions

Nice::CompletionsetState (CompletionState, int=0, const std::string &="")
 Set state, percentage and action memo. More...
 
Nice::CompletionsetState (CompletionState, const Nice::LoggerObject &, int=0, const std::string &="")
 Set state, and action memo and flush logger lines. More...
 
Nice::CompletionsetState (CompletionState, const Nice::SeqLoggerObject &, int=0, const std::string &="")
 Set state, logger lines and action memo. More...
 
Nice::CompletionsetState (CompletionState, int=0, const std::string &="")
 
Nice::CompletionsetState (CompletionState, const Nice::LoggerObject &, int=0, const std::string &="")
 
Nice::CompletionsetState (CompletionState, const Nice::SeqLoggerObject &, int=0, const std::string &="")
 

Additional Inherited Members

- Public Attributes inherited from Nice::CompletionVar
::Nice::CompletionState state
 
::Ice::Byte cmd
 
::Ice::Int percent
 
::std::string action
 
::std::string except
 
::Nice::SeqLoggerObject stack
 
::Nice::DateVar timestamp
 
::Ice::Long id
 

Detailed Description

Completion with a exception stack. Contains a state (OK, WARNING, ERROR,...), a time stamp that is updated if states change, a percentage, a stack of messages for a logger.

Author
Florian Briegel
Version
11.02.04
Date
2012-08-10 11:04:58 AM
Todo:
Author
Florian Briegel
Version
11.02.04
Date
2012-08-10 11:04:58 AM
Todo:

Constructor & Destructor Documentation

◆ Completion() [1/4]

Nice::Completion::Completion ( )

default ctor. Sets percentage to zero, timestamp to now, command and action to empty.


◆ Completion() [2/4]

Nice::Completion::Completion ( const Nice::CompletionVar _v)

copy ctor.


◆ Completion() [3/4]

Nice::Completion::Completion ( )

◆ Completion() [4/4]

Nice::Completion::Completion ( const Nice::CompletionVar _v)

Member Function Documentation

◆ abort() [1/2]

Nice::Completion Nice::Completion::abort ( )
static

create a completion in ABORT state. Set time stamp to now.


Returns
the completion.

◆ abort() [2/2]

static Nice::Completion Nice::Completion::abort ( )
static

◆ action() [1/2]

const std::string& Nice::Completion::action ( ) const
inline

◆ action() [2/2]

const std::string& Nice::Completion::action ( ) const
inline

◆ command() [1/2]

template<typename Type >
Type Nice::Completion::command ( ) const
inline

◆ command() [2/2]

template<typename Type >
Type Nice::Completion::command ( ) const
inline

◆ exceptionString() [1/2]

const std::string& Nice::Completion::exceptionString ( ) const
inline

◆ exceptionString() [2/2]

const std::string& Nice::Completion::exceptionString ( ) const
inline

◆ exec() [1/4]

Nice::Completion Nice::Completion::exec ( )
static

create a completion with EXEC state. Command set to 0 and time stamp to now.


Returns
The completion.

◆ exec() [2/4]

static Nice::Completion Nice::Completion::exec ( )
static

◆ exec() [3/4]

template<typename Type >
Nice::Completion Nice::Completion::exec ( Type  _cmd)
inlinestatic

◆ exec() [4/4]

template<typename Type >
static Nice::Completion Nice::Completion::exec ( Type  _cmd)
static

◆ getCompletion() [1/4]

const Nice::Completion& Nice::Completion::getCompletion ( ) const
inline

◆ getCompletion() [2/4]

const Nice::Completion& Nice::Completion::getCompletion ( ) const
inline

◆ getCompletion() [3/4]

Nice::Completion& Nice::Completion::getCompletion ( )
inline

◆ getCompletion() [4/4]

Nice::Completion& Nice::Completion::getCompletion ( )
inline

◆ id() [1/2]

Nice::I64 Nice::Completion::id ( ) const
inline

◆ id() [2/2]

Nice::I64 Nice::Completion::id ( ) const
inline

◆ isDone() [1/4]

bool Nice::Completion::isDone ( ) const

compare state with OK This comparing the state with OK and other error states.


Returns
if the state is OK or WARNING or ERROR or FATAL.

◆ isDone() [2/4]

bool Nice::Completion::isDone ( ) const

◆ isDone() [3/4]

bool Nice::Completion::isDone ( const Nice::CompletionVar _v1) const

Parameters
_v1A time variable which must be newer than the local time variable to result in a return value of true.

◆ isDone() [4/4]

bool Nice::Completion::isDone ( const Nice::CompletionVar _v1) const

◆ isOK() [1/2]

bool Nice::Completion::isOK ( ) const

◆ isOK() [2/2]

bool Nice::Completion::isOK ( ) const

compare state with OK


◆ isValid() [1/2]

bool Nice::Completion::isValid ( ) const

◆ isValid() [2/2]

bool Nice::Completion::isValid ( ) const

◆ operator!=() [1/2]

bool Nice::Completion::operator!= ( const Nice::Completion _c) const

compare time stamps and Id


Parameters
_c

◆ operator!=() [2/2]

bool Nice::Completion::operator!= ( const Nice::Completion ) const

◆ operator+=() [1/2]

Nice::Completion & Nice::Completion::operator+= ( Nice::Int  _val)

◆ operator+=() [2/2]

Nice::Completion& Nice::Completion::operator+= ( Nice::Int  )

◆ operator<() [1/2]

bool Nice::Completion::operator< ( const Nice::Completion _c) const

compare time stamps


Parameters
_c
Returns
true if this time was earlier than _c

◆ operator<() [2/2]

bool Nice::Completion::operator< ( const Nice::Completion ) const

◆ operator=() [1/2]

Nice::Completion & Nice::Completion::operator= ( const Nice::CompletionVar _v)

Copy ctor.


Returns
this object.

◆ operator=() [2/2]

Nice::Completion& Nice::Completion::operator= ( const Nice::CompletionVar )

◆ operator==() [1/2]

bool Nice::Completion::operator== ( const Nice::Completion _c) const

compare time stamps and Id


Parameters
_c

◆ operator==() [2/2]

bool Nice::Completion::operator== ( const Nice::Completion ) const

◆ percent() [1/2]

double Nice::Completion::percent ( ) const
inline

◆ percent() [2/2]

double Nice::Completion::percent ( ) const
inline

◆ setAbort() [1/2]

Nice::Completion& Nice::Completion::setAbort ( const Nice::LoggerObject _o = Nice::LoggerObject())
inline

◆ setAbort() [2/2]

Nice::Completion& Nice::Completion::setAbort ( const Nice::LoggerObject _o = Nice::LoggerObject())
inline

◆ setAction() [1/2]

Nice::Completion& Nice::Completion::setAction ( Nice::Int  _v,
const std::string &  _action 
)

◆ setAction() [2/2]

Nice::Completion & Nice::Completion::setAction ( Nice::Int  _v,
const std::string &  _action 
)

Parameters
_vNew percentage value.
_aNew action value.
Returns
this object.

◆ setCommand() [1/2]

template<typename Type >
Nice::Completion& Nice::Completion::setCommand ( Type  _cmd)
inline

◆ setCommand() [2/2]

template<typename Type >
Nice::Completion& Nice::Completion::setCommand ( Type  _cmd)
inline

◆ setCompletion() [1/2]

void Nice::Completion::setCompletion ( const Nice::Completion _c)
inline

◆ setCompletion() [2/2]

void Nice::Completion::setCompletion ( const Nice::Completion _c)
inline

◆ setDone() [1/2]

Nice::Completion& Nice::Completion::setDone ( )
inline

◆ setDone() [2/2]

Nice::Completion& Nice::Completion::setDone ( )
inline

◆ setError() [1/8]

Nice::Completion& Nice::Completion::setError ( const Nice::Exception _e)
inline

◆ setError() [2/8]

Nice::Completion& Nice::Completion::setError ( const Nice::Exception _e)
inline

◆ setError() [3/8]

Nice::Completion& Nice::Completion::setError ( const Nice::LoggerObject _o,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setError() [4/8]

Nice::Completion& Nice::Completion::setError ( const Nice::LoggerObject _o,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setError() [5/8]

Nice::Completion& Nice::Completion::setError ( const Nice::SeqLoggerObject _oo,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setError() [6/8]

Nice::Completion& Nice::Completion::setError ( const Nice::SeqLoggerObject _oo,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setError() [7/8]

Nice::Completion& Nice::Completion::setError ( const std::string &  _log,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setError() [8/8]

Nice::Completion& Nice::Completion::setError ( const std::string &  _log,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setException() [1/4]

Nice::Completion& Nice::Completion::setException ( const Nice::Exception _ex)
inline

◆ setException() [2/4]

Nice::Completion& Nice::Completion::setException ( const Nice::Exception _ex)
inline

◆ setException() [3/4]

Nice::Completion& Nice::Completion::setException ( const std::string &  _ex)
inline

◆ setException() [4/4]

Nice::Completion& Nice::Completion::setException ( const std::string &  _ex)
inline

◆ setFatal() [1/8]

Nice::Completion& Nice::Completion::setFatal ( const Nice::Exception _e)
inline

◆ setFatal() [2/8]

Nice::Completion& Nice::Completion::setFatal ( const Nice::Exception _e)
inline

◆ setFatal() [3/8]

Nice::Completion& Nice::Completion::setFatal ( const Nice::LoggerObject _o,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setFatal() [4/8]

Nice::Completion& Nice::Completion::setFatal ( const Nice::LoggerObject _o,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setFatal() [5/8]

Nice::Completion& Nice::Completion::setFatal ( const Nice::SeqLoggerObject _oo,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setFatal() [6/8]

Nice::Completion& Nice::Completion::setFatal ( const Nice::SeqLoggerObject _oo,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setFatal() [7/8]

Nice::Completion& Nice::Completion::setFatal ( const std::string &  _log,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setFatal() [8/8]

Nice::Completion& Nice::Completion::setFatal ( const std::string &  _log,
const Nice::Exception _e = Nice::Exception() 
)
inline

◆ setPercent() [1/2]

Nice::Completion& Nice::Completion::setPercent ( Nice::Int  _v)
inline

◆ setPercent() [2/2]

Nice::Completion& Nice::Completion::setPercent ( Nice::Int  _v)
inline

◆ setState() [1/6]

Nice::Completion& Nice::Completion::setState ( CompletionState  ,
int  = 0,
const std::string &  = "" 
)
protected

◆ setState() [2/6]

Nice::Completion & Nice::Completion::setState ( CompletionState  _s,
int  _p = 0,
const std::string &  _a = "" 
)
protected

Set state, percentage and action memo.


Parameters
_sThe new completion state.
_pThe new percentage.
_aThe new action variable.
Returns
This object.

◆ setState() [3/6]

Nice::Completion & Nice::Completion::setState ( CompletionState  _s,
const Nice::LoggerObject _o,
int  _p = 0,
const std::string &  _a = "" 
)
protected

Set state, and action memo and flush logger lines.


Parameters
_sThe new completion state.
_oA logger object to get the existing stack.
_pThe new percentage.
_aThe new action variable.
Returns
This object.

◆ setState() [4/6]

Nice::Completion& Nice::Completion::setState ( CompletionState  ,
const Nice::LoggerObject ,
int  = 0,
const std::string &  = "" 
)
protected

◆ setState() [5/6]

Nice::Completion & Nice::Completion::setState ( CompletionState  _s,
const Nice::SeqLoggerObject _oo,
int  _p = 0,
const std::string &  _a = "" 
)
protected

Set state, logger lines and action memo.


Parameters
_sThe new completion state.
_ooA new filler of the stack
_aThe new action variable.
Returns
This object.

◆ setState() [6/6]

Nice::Completion& Nice::Completion::setState ( CompletionState  ,
const Nice::SeqLoggerObject ,
int  = 0,
const std::string &  = "" 
)
protected

◆ setStop() [1/2]

Nice::Completion& Nice::Completion::setStop ( )
inline

◆ setStop() [2/2]

Nice::Completion& Nice::Completion::setStop ( )
inline

◆ setWarning() [1/4]

Nice::Completion& Nice::Completion::setWarning ( const Nice::LoggerObject _o)
inline

◆ setWarning() [2/4]

Nice::Completion& Nice::Completion::setWarning ( const Nice::LoggerObject _o)
inline

◆ setWarning() [3/4]

Nice::Completion& Nice::Completion::setWarning ( const std::string &  _log)
inline

◆ setWarning() [4/4]

Nice::Completion& Nice::Completion::setWarning ( const std::string &  _log)
inline

◆ stack() [1/2]

const Nice::SeqLoggerObject& Nice::Completion::stack ( ) const
inline

◆ stack() [2/2]

const Nice::SeqLoggerObject& Nice::Completion::stack ( ) const
inline

◆ start() [1/2]

Nice::Completion& Nice::Completion::start ( const std::string &  _action = "")
inline

◆ start() [2/2]

Nice::Completion& Nice::Completion::start ( const std::string &  _action = "")
inline

◆ state() [1/2]

Nice::CompletionState Nice::Completion::state ( ) const
inline

◆ state() [2/2]

Nice::CompletionState Nice::Completion::state ( ) const
inline

◆ stop() [1/2]

Nice::Completion Nice::Completion::stop ( )
static

create a completion with STOP state. Set time stamp to now.


Returns
the completion

◆ stop() [2/2]

static Nice::Completion Nice::Completion::stop ( )
static

◆ timestamp() [1/2]

Nice::Date Nice::Completion::timestamp ( ) const
inline

◆ timestamp() [2/2]

Nice::Date Nice::Completion::timestamp ( ) const
inline

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