+ };
+
+ class GenObjRegister: public SALOMEDSImpl_AbstractCallback
+ {
+ public:
+ GenObjRegister(CORBA::ORB_ptr orb)
+ {
+ _orb = CORBA::ORB::_duplicate(orb);
+ }
+ virtual void RegisterGenObj (const std::string& theIOR)
+ {
+ try
+ {
+ CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str());
+ if ( obj->_non_existent() ) return;
+ SALOME::GenericObj_var gobj = SALOME::GenericObj::_narrow(obj);
+ if(! CORBA::is_nil(gobj) )
+ {
+ gobj->Register();
+ }
+ }
+ catch(const CORBA::Exception& e)
+ {
+ }
+ }
+ virtual void UnRegisterGenObj(const std::string& theIOR)
+ {
+ try
+ {
+ CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str());
+ if ( obj->_non_existent() ) return;
+ SALOME::GenericObj_var gobj = SALOME::GenericObj::_narrow(obj);
+ if(! CORBA::is_nil(gobj) )
+ {
+ gobj->UnRegister();
+ }
+ }
+ catch(const CORBA::Exception& e)
+ {
+ }
+ }