![]() |
Overview Returns the default CORBA::Context object. Original class CORBA::ORB Exceptions CORBA::SystemException
Intended Usage
This method is intended to be used by client applications to obtain a default CORBA::Context object, which can be passed to IDL operations that require a Context parameter. The default CORBA::Context object contains a name/value pair for each environment variable set in the calling process's environment.
IDL Syntax
CORBA::Status get_default_context (CORBA::Context_ptr& ctx);
Input parameters
- ctx
- A pointer for a CORBA::Context object, passed by reference, to be initialized by the CORBA::ORB::get_default_context method. The caller assumes ownership of the CORBA::Context object.
Return values
- CORBA::Status
- A zero return value indicates success.
Example
/* The following program creates a CORBA::Context object and generates system exception if appropriate */ #include "corba.h" #include int main(int argc, char* argv[]) { int rc = 0; CORBA::Context_ptr Ctxtptr = CORBA::Context::_nil(); /* assume orb initialized */ extern CORBA::ORB_ptr orb; try { CORBA::Status st = orb->get_default_context( Ctxtptr); } catch (CORBA::SystemException &se) { cout << "exception: " << se.id() << endl; rc="1;" } return rc; }