21 #ifndef __SALOMESDS_AUTOREFCOUNTPTR_HXX__
22 #define __SALOMESDS_AUTOREFCOUNTPTR_HXX__
26 #include "omniORB4/CORBA.h"
30 class POAHolder :
public virtual PortableServer::ServantBase
33 virtual PortableServer::POA_var
getPOA()
const = 0;
36 PortableServer::POA_var poa(
getPOA());
37 PortableServer::ObjectId_var id(poa->activate_object(
this));
38 CORBA::Object_var ret(poa->id_to_reference(
id));
44 PortableServer::POA_var poa(
getPOA());
45 PortableServer::ObjectId_var oid(poa->servant_to_id(
this));
46 poa->deactivate_object(oid);
66 operator T *() {
return _ptr; }
67 operator const T *()
const {
return _ptr; }
76 template<
class T,
class U>
79 T *subPtr(autoSubPtr);
80 U *ptr(dynamic_cast<U *>(subPtr));
87 template<
class T,
class U>
90 T *subPtr(autoSubPtr);
91 U *ptr(dynamic_cast<U *>(subPtr));
93 throw Exception(
"DynamicCastSafe : U is not a subtype of T !");
113 operator T *() {
return _ptr; }
114 operator const T *()
const {
return _ptr; }
120 _ptr->enforcedRelease();