common/exceptions.h File Reference

Definition of a variety of exceptions used by consmgr. More...

#include <string>
#include <iostream>
#include "consmgr.h"

Include dependency graph for exceptions.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CMException
 An abstract exception class. More...
class  pthread_exception
 An exception object to carry information related to failures of pthread library calls. More...
class  fireball
class  CMInvalidParameter
 An exception to indicate that a method was invoked with one or more invalid parameters or conditions. More...
class  CMUnsupported
 An exception to indicate an unsupported operation. More...
class  CMStateChange
class  CMFailure

Defines

#define PTHREAD_CHECK_AND_THROW(rc, str)   if ((rc) != 0) throw(pthread_exception(__FILE__, __LINE__, (rc), (str)))
 pthread error handling macro.
#define CATCH_OR_DIE(ec)
#define CATCH_STR_OR_DIE(ec)

Variables

char * __progname


Detailed Description

Definition of a variety of exceptions used by consmgr.

All of these are eventually descendants of std::exception.

Definition in file exceptions.h.


Define Documentation

#define PTHREAD_CHECK_AND_THROW ( rc,
str   )     if ((rc) != 0) throw(pthread_exception(__FILE__, __LINE__, (rc), (str)))

#define CATCH_OR_DIE ( ec   ) 

Value:

catch (pthread_exception &pe) { \
                                    std::cerr << pe.what() << std::endl; \
                                    exit((ec)); \
                                } catch (fireball &f) { \
                                    f.bail(std::cerr); \
                                } catch (std::exception &e) { \
                                    std::cerr << "Standard exception: " \
                                              << e.what() << std::endl; \
                                    exit((ec)); \
                                } catch (...)
A define to compress the common code of dealing with exception types we've defined [above], and returned error strings. The (...) case is left to be defined for each individual try{} block.

Definition at line 167 of file exceptions.h.

Referenced by Incoming::listener_thread(), Connection::shutdown(), MasterController::start_connections(), and TTYConnector::~TTYConnector().

#define CATCH_STR_OR_DIE ( ec   ) 

Value:

catch (pthread_exception &pe) { \
                                    std::cerr << pe.what() << std::endl; \
                                    exit((ec)); \
                                } catch (fireball &f) { \
                                    f.bail(std::cerr); \
                                } catch (char *s) { \
                                    std::cerr << s << std::endl; \
                                    exit((ec)); \
                                } catch (string &s) { \
                                    std::cerr << s << std::endl; \
                                    exit((ec)); \
                                } catch (std::exception &e) { \
                                    std::cerr << "Standard exception: " \
                                              << e.what() << std::endl; \
                                    exit((ec)); \
                                } catch (...)

Definition at line 178 of file exceptions.h.

Referenced by main(), Connection::manager(), and MasterController::start_connections().


Variable Documentation

char* __progname


Generated on Tue May 13 11:32:36 2008 for consmgr by  doxygen 1.5.5