Horus Doc || Corba Reference || Corba   Client Server   Stubs C++   Stubs Java   Servant Generator  

HxMessageHolder.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (c) 2001, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Marc Navarro (mnavarro@wins.uva.nl)
00008  */
00009 
00010 #ifndef HxMessageHolder_h
00011 #define HxMessageHolder_h
00012 
00013 #include "HxIo.h"
00014 
00015 
00016 class HxMessageHolder
00017 {
00018 public:
00019 
00020                             HxMessageHolder();
00021 
00022     virtual STD_OSTREAM&    errorStream();
00023     virtual void            flush();
00024 
00025     virtual void            clearMessage();
00026     virtual bool            hasError();
00027     virtual char*           getMessage();
00028 
00029     //virtual void          beginCapture();
00030     //virtual char*         endCapture();
00031 
00032 private:
00033     char*                   _message;
00034     //int                   _capturing;
00035     STD_OSTRSTREAM          _errorStr;
00036 
00037 
00038 };
00039 
00040 
00041 // This class handles the errors in the ctor and dtor. To add error handling
00042 // to a function you just have to declare a HxEnvCorbaCapturer at the begining
00043 // of the function.
00044 
00045 /*template<class ExceptionT>
00046 class HxEnvCorbaCapturer
00047 {
00048 public:
00049 
00050     HxEnvCorbaCapturer()
00051     {
00052         _env = dynamic_cast<HxEnvCorba*>(HxEnvironment::instance());
00053         _env->beginCapture();
00054     }
00055 
00056     ~HxEnvCorbaCapturer()
00057     {
00058         char* error = _env->endCapture();
00059         if(error) throw ExceptionT(error);
00060     }
00061 
00062 private:
00063     HxEnvCorba* _env;
00064 };*/
00065 
00066 #endif

Generated on Tue Feb 3 14:20:11 2004 for CorbaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001