Collaboration diagram for CORBA::Environment:
Public Member Functions
|Environment (const Environment &ACE_TRY_ENV)|
|Copy constructor. |
|Environment &||operator= (const Environment &ACE_TRY_ENV)|
|Destructor, release the exception. |
|int||exception_type (void) const|
|const char *||exception_id (void) const|
|return the repository ID for the exception. |
|Clear the exception. |
|void||print_exception (const char *info, FILE *f=stdout) const|
Static Public Member Functions
|static Environment *||_duplicate (Environment *)|
|Some static methods that need to be defined in every pseudo object. |
|static Environment *||_nil (void)|
|static CORBA::Environment &||default_environment (void)|
|CORBA::Exception *exception |
|Return the contained CORBA::Exception. |
|void exception CORBA::Exception *||ex|
|Set the contained CORBA::Exception to <ex>. |
Private Member Functions
|Environment (TAO_ORB_Core *orb_core)|
|Pointer to the exception object contained in the environment. |
|The previous environment on the "default environment stack". |
A CORBA::Environment is a way to automagically ensure that exception data is freed -- the "var" class for Exceptions. It adds just a bit of convenience function support, helping classify exceptions as well as reducing memory leakage. The thread has a default environment to simplify porting between platforms that support native C++ exceptions and those that don't. This is a TSS resource (always), but with a twist: if the user creates a new environment the old one is "pushed" (actually the new one remembers it), eventually the new environment destructor pops itself from the stack and we recover the old environment. This means that if the user create a new environment and somebody calls a function using the default one the exception will still be received in the environment created by the user. The only drawback is that environments life time must nest properly, this shouldn't be a problem because environments are usually created on the stack, but, the spec allows their creation on the heap and/or as class members; we need to investigate the tradeoffs and take a decision.
The default constructor. The environment will hold no exceptions.
Destructor, release the exception.
Initialize using a well known ORB Core; this is intended for the bootstraping of the ORB_Core, not for general consumption.
Some static methods that need to be defined in every pseudo object.
Clear the exception.
|CORBA::Environment & CORBA::Environment::default_environment||(||void||)||
|const char * CORBA::Environment::exception_id||(||void||)||const|
return the repository ID for the exception.
Return if the exception is a user exception or a system exception.
|void CORBA::Environment::print_exception||(||const char *||info,|
|FILE *|| f = |
Print the exception to output determined by f. This function is not CORBA compliant.
Pointer to the exception object contained in the environment.
The previous environment on the "default environment stack".