AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.5.4
AMPS::AMPSException Class Reference

Base class for all exceptions in AMPS. More...

#include <AMPSException.hpp>

+ Inheritance diagram for AMPS::AMPSException:

Public Member Functions

 AMPSException (const std::string &message_, amps_result result_)
 Construct an AMPSException from a text message. More...
 
 AMPSException (amps_handle client_, amps_result result_)
 Construct an AMPSException from the last error message on client. More...
 
const char * toString () const
 Returns a null-terminated string containing self's error message.
 
virtual const char * getClassName () const
 Returns the actual name of the subclass thrown – useful when RTTI is disabled, but you'd still like to log the exact exception type.
 

Static Public Member Functions

template<class T >
static void throwFor (const T &context_, amps_result result_)
 Constructs and throws the appropriate exception corresponding to a given result. More...
 

Detailed Description

Base class for all exceptions in AMPS.

May be constructed with text, or with a client handle, in which case the exception text is made equal to the last error message on that client.

Constructor & Destructor Documentation

AMPS::AMPSException::AMPSException ( const std::string &  message_,
amps_result  result_ 
)
inline

Construct an AMPSException from a text message.

Parameters
message_The text of the error message.
result_The last amps_result you were given.
AMPS::AMPSException::AMPSException ( amps_handle  client_,
amps_result  result_ 
)
inline

Construct an AMPSException from the last error message on client.

Parameters
client_The client to retrieve an error message from.
result_The result code you last retrieved from this client.

Member Function Documentation

template<class T >
static void AMPS::AMPSException::throwFor ( const T &  context_,
amps_result  result_ 
)
static

Constructs and throws the appropriate exception corresponding to a given result.

Parameters
context_The object to pass to the exception's constructor.
result_the result that should be used to determine the exception type.

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