ubit
Public Member Functions | Protected Attributes | List of all members
ubit::UErrorHandler Class Reference

Error management. More...

#include <uappli.hpp>

Inheritance diagram for ubit::UErrorHandler:
ubit::UObject

Public Member Functions

 UErrorHandler (const UStr &label, std::ostream *out_stream=&std::cerr)
 creates a new error handler. More...
 
virtual void setOutputStream (std::ostream *)
 specifies on which output stream errors are written (errors not written on a stream if argument is null).
 
virtual void setOutputBuffer (UStr *)
 specifies a string buffer on which errors are written (errors not written on a buffer if argument is null).
 
UStrlabel ()
 returns the label property of this UErrorHandler.
 
virtual void warning (const char *funcname, const char *format,...) const
 raises a warning; shortcut for raiseError(UError::WARNING, null, ...).
 
virtual void error (const char *funcname, const char *format,...) const
 raises an error; shortcut for raiseError(UError::ERROR, null, ...).
 
virtual void error (int errnum, const UObject *, const char *funcname, const char *format,...) const
 raises an error; shortcut for raiseError(UError::ERROR, ...).
 
virtual void parserError (int errnum, const UChar *text_buffer, const char *msg_start, const UStr &name, const char *msg_end, const UChar *line) const
 used by XML and Style parsers to raise a formatted error.
 
virtual void raiseError (int errnum, const UObject *, const char *funcname, const char *format, va_list) const
 raises an error: prints out a message and/or generate an exception. More...
 
virtual void raiseError (int errnum, UStr *msg) const
 
virtual const char * getErrorName (int errnum) const
 
virtual void formatMessage (UError &, const char *format, va_list) const
 
virtual void printOnStream (const UError &) const
 
virtual void printOnBuffer (const UError &) const
 
- Public Member Functions inherited from ubit::UObject
 UObject (const UObject &)
 
UObjectoperator= (const UObject &)
 
virtual const UClassgetClass () const
 instance method that returns the metaclass of this object. More...
 
const UStrgetClassName () const
 returns getClass().getName().
 
bool isDeletable () const
 checks if this object can be destroyed by 'delete'. More...
 
bool isConst () const
 checks whether the content of this object can be modified ( More...
 
UObjectsetConst ()
 specifies that the content of this object cannot be modified. More...
 
bool isAutoUpdate () const
 return current update policy: More...
 
UObjectsetAutoUpdate (bool state=true)
 changes the update policy of this object when its is modified. More...
 
bool isIgnoringChangeCallbacks () const
 return true if change callbacks are fired.
 
UObjectignoreChangeCallbacks (bool state)
 change callbacks are not fired if argument is true.
 
virtual UNodetoNode ()
 dynamic cast: returns this object if it derives from UNode and null otherwise.
 
virtual const UNodetoNode () const
 dynamic cast: returns this object if it derives from UNode and null otherwise.
 
virtual UAttrtoAttr ()
 dynamic cast: returns this object if it derives from UAttr and null otherwise.
 
virtual const UAttrtoAttr () const
 dynamic cast: returns this object if it derives from UAttr and null otherwise.
 
virtual UElemtoElem ()
 dynamic cast: returns this object if it derives from UElem and null otherwise.
 
virtual const UElemtoElem () const
 dynamic cast: returns this object if it derives from UElem and null otherwise.
 
virtual UDatatoData ()
 dynamic cast: returns this object if it derives from UData and null otherwise.
 
virtual const UDatatoData () const
 dynamic cast: returns this object if it derives from UData and null otherwise.
 
virtual UStrtoStr ()
 dynamic cast: returns this object if it derives from UStr and null otherwise.
 
virtual const UStrtoStr () const
 dynamic cast: returns this object if it derives from UStr and null otherwise.
 
virtual UCalltoCall ()
 dynamic cast: returns this object if it derives from UCall and null otherwise.
 
virtual const UCalltoCall () const
 dynamic cast: returns this object if it derives from UCall and null otherwise.
 
virtual UBoxtoBox ()
 dynamic cast: returns this object if it derives from UBox and null otherwise.
 
virtual const UBoxtoBox () const
 dynamic cast: returns this object if it derives from UBox and null otherwise.
 
virtual UWintoWin ()
 dynamic cast: returns this object if it derives from UWin and null otherwise.
 
virtual const UWintoWin () const
 dynamic cast: returns this object if it derives from UWin and null otherwise.
 
virtual UMenutoMenu ()
 dynamic cast: returns this object if it derives from UMenu and null otherwise.
 
virtual const UMenutoMenu () const
 dynamic cast: returns this object if it derives from UMenu and null otherwise.
 
State getState () const
 returns the current object state.
 
void setState (State s)
 changes the object state.
 
PtrCount getPtrCount () const
 [impl] returns the number of uptr<> smart pointers that are pointing to this object.
 
bool checkConst () const
 [impl] produces an error if this object is logically constant ( More...
 
bool isDestructed () const
 [impl] this object has been destructed (but memory has not been freed yet).
 
bool isDestructing () const
 [impl] this object is being destructed (one of its destructors has been called).
 
virtual bool hasSceneGraphParent () const
 
void * operator new (size_t)
 < [impl] returns true if there is at least one scene graph parent (redefined by UNode). More...
 
void operator delete (void *)
 delete operator is forbidden on instances that derive from UObject.
 
void addPtr () const
 [Impl] a uptr is added to this object.
 
void removePtr () const
 [Impl] a uptr is removed from this object.
 

Protected Attributes

uptr< UStrplabel
 
uptr< UStrpbuffer
 
std::ostream * fout
 
- Protected Attributes inherited from ubit::UObject
PtrCount ptr_count
 
Modes omodes
 
State ostate
 

Additional Inherited Members

- Public Types inherited from ubit::UObject
typedef unsigned char State
 
typedef short PtrCount
 
- Static Public Member Functions inherited from ubit::UObject
static const char * getVersion ()
 returns the version of the Ubit package.
 
static const UClassClass ()
 class method that returns the metaclass of this class. More...
 
static UStylecreateStyle ()
 
- Static Public Attributes inherited from ubit::UObject
static UConst UCONST
 UCONST can be given as an argument to some constructors to make the object constant. More...
 

Detailed Description

Error management.

Constructor & Destructor Documentation

§ UErrorHandler()

UErrorHandler::UErrorHandler ( const UStr label,
std::ostream *  out_stream = &std::cerr 
)

creates a new error handler.

  • 'label' identifies the handler (it is the name of the application for the default UAppli error handler).
  • 'out_stream' specifies on which output stream errors are written. std::cerr is used by default. No errors are written if this argument is null.

Member Function Documentation

§ raiseError()

virtual void ubit::UErrorHandler::raiseError ( int  errnum,
const UObject ,
const char *  funcname,
const char *  format,
va_list   
) const
virtual

raises an error: prints out a message and/or generate an exception.

this method:

  • displays an error message (on std::cerr by default, see below)
  • throws a UError exception if 'errnum' is < 0. Predefined errnums are UError::WARNING, ERROR, FATAL_ERROR, INTERNAL_ERROR but other values may be used if needed.
  • 'funcname' should be the name of the function where the error occured
  • 'format'is a printf-like format
  • '...' is a variadic list of arguments that correspond to 'format'.

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