24#ifndef OMNIEVENTS__ORB_H
25#define OMNIEVENTS__ORB_H
34# include <omniORB3/CORBA.h>
38# include <omniORB4/CORBA.h>
42# define IFELSE_OMNIORB4(omniORB4_code,default_code) omniORB4_code
43# define IF_OMNIORB4(omniORB4_code) omniORB4_code
45# define IFELSE_OMNIORB4(omniORB4_code,default_code) default_code
46# define IF_OMNIORB4(omniORB4_code)
50 {if(omniORB::trace(l)){omniORB::logger log("omniEvents: ");log<<x<<"\n";}}
52#define NP_MINORSTRING(systemException) \
53 ((systemException).NP_minorString()?(systemException).NP_minorString():"??")
56#define AS_STR_1(x) AS_STR_2(x)
58#define HERE __FILE__ ":" AS_STR_1(__LINE__)
93 PortableServer::Current_ptr _POACurrent;
119 CORBA::Object_ptr obj,
134 CORBA::Object_var obj =
Orb::inst().
_orb->string_to_object(oidStr);
135 if(CORBA::is_nil(obj.in()))
136 throw CORBA::BAD_PARAM();
139 typename T::_var_type result =T::_unchecked_narrow(obj);
141 typename T::_var_type result =T::_narrow(obj);
143 if(CORBA::is_nil(result.in()))
144 throw CORBA::BAD_PARAM();
146 return result._retn();
T::_ptr_type string_to_(const char *oidStr)
Converts a string to a narrowed reference.
Interface for classes that wish to receive callbacks from deferred requests.
Singleton class that owns the ORB and various initial references.
PortableServer::POA_var _RootPOA
pair< CORBA::Request_ptr, Callback * > RequestCallback_t
~Orb()
Destructor needs to be public to keep MS VC++6 happy.
list< RequestCallback_t > _deferredRequests
void cancelCallback(const Callback *callback)
Called by Callback objects when they are destroyed.
void shutdown(int)
Sets _shutdownRequested.
friend void OmniEvents_Orb_shutdown(int)
Signal handler, sets Orb::_shutdownRequested.
CosNaming::NamingContext_var _NameService
void deferredRequest(CORBA::Request_ptr req, Callback *callback=NULL)
Adopts the request and then stores it in _deferredRequests.
void reportObjectFailure(const char *here, CORBA::Object_ptr obj, CORBA::Exception *ex)
Called by omniEvents when an object has failed (fatal exception).
void resolveInitialReferences()
_orb must already have been initialized before this method is called.
omni_mutex _deferredRequestsLock
void run()
Parks the main thread, but also picks up (and ignores) responses from orphan requests.
PortableServer::POA_var _omniINSPOA