00001 #ifndef _BONOBOMM_SERVERS_SERVANT_OWNER_H
00002 #define _BONOBOMM_SERVERS_SERVANT_OWNER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <bonobo/bonobo-main.h>
00028 #include <orbitcpp/orb-cpp/orbitcpp.h>
00029
00030
00031
00032 namespace Gnome
00033 {
00034
00035 namespace Bonobo
00036 {
00037
00038 namespace Servers
00039 {
00040
00041
00042
00043 template <class S>
00044 class ServantOwner {
00045 protected:
00046 S m_servant;
00047
00048 ~ServantOwner()
00049 {
00050 _orbitcpp::CEnvironment env;
00051 PortableServer_POA poa = bonobo_poa();
00052
00053
00054 PortableServer_Servant servant =
00055 m_servant._orbitcpp_get_c_servant();
00056 PortableServer_ObjectId* oid =
00057 PortableServer_POA_servant_to_id(poa, servant, env._orbitcpp_cobj());
00058 env.propagate_poaex();
00059 PortableServer_POA_deactivate_object(poa, oid,
00060 env._orbitcpp_cobj());
00061 env.propagate_poaex();
00062 }
00063 };
00064
00065 }
00066 }
00067 }
00068
00069
00070 #endif //_BONOBOMM_SERVERS_UNKNOWN_CPPIMPL_H
00071