24 #ifndef OMNIEVENTS__SERVANT_H
25 #define OMNIEVENTS__SERVANT_H
32 # include <omniORB3/CORBA.h>
36 # include <omniORB4/CORBA.h>
43 #if OMNIEVENTS__DEBUG_ALL
44 # define OMNIEVENTS__DEBUG_REF_COUNTS 1
45 # define OMNIEVENTS__DEBUG_SERVANT 1
49 # define OMNIEVENTS__DEBUG_REF_COUNTS 0
52 # define OMNIEVENTS__DEBUG_SERVANT 0
55 #if OMNIEVENTS__DEBUG_REF_COUNTS
56 # define OMNIEVENTS__DEBUG_REF_COUNTS__DECL void _add_ref();void _remove_ref();
57 # define OMNIEVENTS__DEBUG_REF_COUNTS__DEFN(C) \
58 void C::_add_ref() { \
59 DB(20,#C "::_add_ref()") \
60 PortableServer::RefCountServantBase::_add_ref(); \
62 void C::_remove_ref() { \
63 DB(20,#C "::_remove_ref()") \
64 PortableServer::RefCountServantBase::_remove_ref(); \
68 # define OMNIEVENTS__DEBUG_REF_COUNTS__DECL
70 # define OMNIEVENTS__DEBUG_REF_COUNTS__DEFN(C)
100 return T::_unchecked_narrow(obj.in());
102 return T::_narrow(obj.in());
113 class Servant :
public virtual PortableServer::ServantBase
119 #if OMNIEVENTS__DEBUG_SERVANT
120 static int _objectCount;
124 Servant(PortableServer::POA_ptr poa);
CORBA::Object_ptr createReference(PortableServer::POA_ptr poa, const char *repositoryId)
Helper method called by createNarrowedReference().
T::_ptr_type createNarrowedReference(PortableServer::POA_ptr poa, const char *repositoryId)
Helper method that creates a new CORBA object and then narrows it to the appropriate type.
char * newUniqueId()
Generates a unique object ID string, based upon the current PID and time.
virtual PortableServer::POA_ptr _default_POA()
PortableServer::POA_var _poa
void activateObjectWithId(const char *oidStr)
Calls activate_object_with_id() to activate this servant in its POA.
Servant()
No default constructor.
void deactivateObject()
Calls deactivate_object() to deactivate this servant in its POA.