PVData C++ 8.0.7
Loading...
Searching...
No Matches
epics::pvData::Status Class Reference

Status. More...

#include <misc/pv/status.h>

Inheritance diagram for epics::pvData::Status:
Collaboration diagram for epics::pvData::Status:

Public Types

enum  StatusType { STATUSTYPE_OK , STATUSTYPE_WARNING , STATUSTYPE_ERROR , STATUSTYPE_FATAL }
 
typedef std::tr1::shared_ptr< Statusshared_pointer
 
typedef std::tr1::shared_ptr< const Statusconst_shared_pointer
 
typedef std::tr1::weak_ptr< Statusweak_pointer
 
typedef std::tr1::weak_ptr< const Statusconst_weak_pointer
 

Public Member Functions

 Status ()
 
 Status (StatusType type, std::string const &message)
 
 Status (StatusType type, std::string const &message, std::string const &stackDump)
 
StatusType getType () const
 
const std::string & getMessage () const
 
const std::string & getStackDump () const
 
bool isOK () const
 
bool isSuccess () const
 
 operator truth_type () const
 
void maximize (const Status &o)
 
Statusoperator|= (const Status &o)
 short hand for "this->maximize(o)"
 
void serialize (ByteBuffer *buffer, SerializableControl *flusher) const
 
void deserialize (ByteBuffer *buffer, DeserializableControl *flusher)
 
void dump (std::ostream &o) const
 
- Public Member Functions inherited from epics::pvData::Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static Status warn (const std::string &m)
 
static Status error (const std::string &m)
 
static Status fatal (const std::string &m)
 

Static Public Attributes

static const char * StatusTypeName []
 
static Status Ok
 

Detailed Description

Status.

This is a class for returning status to clients.

Author
mse

Definition at line 28 of file status.h.

Member Typedef Documentation

◆ const_shared_pointer

std::tr1::shared_ptr<const Status> epics::pvData::Status::const_shared_pointer

Definition at line 30 of file status.h.

◆ const_weak_pointer

std::tr1::weak_ptr<const Status> epics::pvData::Status::const_weak_pointer

Definition at line 30 of file status.h.

◆ shared_pointer

std::tr1::shared_ptr<Status> epics::pvData::Status::shared_pointer

Definition at line 30 of file status.h.

◆ weak_pointer

std::tr1::weak_ptr<Status> epics::pvData::Status::weak_pointer

Definition at line 30 of file status.h.

Member Enumeration Documentation

◆ StatusType

Status type enum.

Enumerator
STATUSTYPE_OK 

Operation completed successfully.

STATUSTYPE_WARNING 

Operation completed successfully, but there is a warning message.

STATUSTYPE_ERROR 

Operation failed due to an error.

STATUSTYPE_FATAL 

Operation failed due to an unexpected error.

Definition at line 34 of file status.h.

Constructor & Destructor Documentation

◆ Status() [1/3]

epics::pvData::Status::Status ( )
inline

Creates OK status; STATUSTYPE_OK, empty message and stackDump.

Definition at line 56 of file status.h.

◆ Status() [2/3]

epics::pvData::Status::Status ( StatusType type,
std::string const & message )

Create non-OK status.

◆ Status() [3/3]

epics::pvData::Status::Status ( StatusType type,
std::string const & message,
std::string const & stackDump )

Create non-OK status.

◆ ~Status()

virtual epics::pvData::Status::~Status ( )
inlinevirtual

Definition at line 68 of file status.h.

Member Function Documentation

◆ deserialize()

void epics::pvData::Status::deserialize ( ByteBuffer * buffer,
DeserializableControl * flusher )
virtual

Deserialize buffer.

Parameters
bufferserialization buffer.
flusherdeserialization control.

Implements epics::pvData::Serializable.

◆ error()

static Status epics::pvData::Status::error ( const std::string & m)
inlinestatic

Definition at line 50 of file status.h.

◆ fatal()

static Status epics::pvData::Status::fatal ( const std::string & m)
inlinestatic

Definition at line 51 of file status.h.

◆ getMessage()

const std::string & epics::pvData::Status::getMessage ( ) const
inline

Get error message describing an error. Required if error status.

Returns
error message.

Definition at line 80 of file status.h.

◆ getStackDump()

const std::string & epics::pvData::Status::getStackDump ( ) const
inline

Get stack dump where error (exception) happened. Optional.

Returns
stack dump.

Definition at line 86 of file status.h.

◆ getType()

StatusType epics::pvData::Status::getType ( ) const
inline

Get status type.

Returns
status type, non-null.

Definition at line 74 of file status.h.

◆ isOK()

bool epics::pvData::Status::isOK ( ) const
inline

Convenient OK test. Same as (getType() == StatusType.OK). NOTE: this will return false on WARNING message although operation succeeded. To check if operation succeeded, use isSuccess.

Returns
OK status.
See also
isSuccess()

Definition at line 95 of file status.h.

◆ isSuccess()

bool epics::pvData::Status::isSuccess ( ) const
inline

Check if operation succeeded (OK or WARNING).

Returns
operation success status.

Definition at line 103 of file status.h.

◆ maximize()

void epics::pvData::Status::maximize ( const Status & o)

override this Status if the other has higher StatusType

Status ret;
ret |= call1();
if(ret)
ret |= call2();
return ret;

◆ operator truth_type()

epics::pvData::Status::operator truth_type ( ) const
inline

Definition at line 115 of file status.h.

◆ operator|=()

Status & epics::pvData::Status::operator|= ( const Status & o)
inline

short hand for "this->maximize(o)"

Definition at line 132 of file status.h.

◆ serialize()

void epics::pvData::Status::serialize ( ByteBuffer * buffer,
SerializableControl * flusher ) const
virtual

Serialize field into given buffer.

Parameters
bufferserialization buffer.
flusherflush interface.

Implements epics::pvData::Serializable.

◆ warn()

static Status epics::pvData::Status::warn ( const std::string & m)
inlinestatic

Definition at line 49 of file status.h.

Member Data Documentation

◆ Ok

Status epics::pvData::Status::Ok
static

Definition at line 47 of file status.h.

◆ StatusTypeName

const char* epics::pvData::Status::StatusTypeName[]
static

Definition at line 45 of file status.h.


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