#include <IORManip_Filter.h>
Inheritance diagram for TAO_IORManip_Filter:
Public Member Functions | |
TAO_IORManip_Filter (void) | |
Constructor. | |
virtual | ~TAO_IORManip_Filter (void) |
Destructor. | |
CORBA::Object_ptr | sanitize_profiles (CORBA::Object_ptr object, TAO_Profile *profile=0) |
Protected Member Functions | |
virtual void | filter_and_add (TAO_Profile *profile, TAO_MProfile &profiles, TAO_Profile *guideline=0)=0 |
This will be the bulk of the filtering code. | |
Private Member Functions | |
CORBA::Object_ptr | sanitize (CORBA::Object_ptr object, TAO_Profile *profile) |
The sanitize_profiles() methods call this to do the work. |
Definition at line 36 of file IORManip_Filter.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_IORManip_Filter::TAO_IORManip_Filter | ( | void | ) |
TAO_IORManip_Filter::~TAO_IORManip_Filter | ( | void | ) | [virtual] |
virtual void TAO_IORManip_Filter::filter_and_add | ( | TAO_Profile * | profile, | |
TAO_MProfile & | profiles, | |||
TAO_Profile * | guideline = 0 | |||
) | [protected, pure virtual] |
This will be the bulk of the filtering code.
Implemented in TAO_IORManip_IIOP_Filter.
Referenced by sanitize().
CORBA::Object_ptr TAO_IORManip_Filter::sanitize | ( | CORBA::Object_ptr | object, | |
TAO_Profile * | profile | |||
) | [private] |
The sanitize_profiles() methods call this to do the work.
Definition at line 32 of file IORManip_Filter.cpp.
References CORBA::Object::_nil(), CORBA::Object::_stubobj(), ACE_NEW_THROW_EX, TAO_Stub::base_profiles(), filter_and_add(), TAO_Stub_Auto_Ptr::get(), TAO_MProfile::get_next(), CORBA::is_nil(), TAO_Stub::orb_core(), TAO_MProfile::profile_count(), TAO_Stub_Auto_Ptr::release(), CORBA::string_dup(), TAO_ORB_Core_instance(), and TAO_Stub::type_id.
Referenced by sanitize_profiles().
00034 { 00035 TAO_MProfile profiles = object->_stubobj ()->base_profiles (); 00036 TAO_MProfile new_profiles (profiles.profile_count ()); 00037 TAO_Profile* profile = 0; 00038 00039 while ((profile = profiles.get_next ()) != 0) 00040 { 00041 // Call the filter implementation 00042 this->filter_and_add (profile, new_profiles, guideline); 00043 } 00044 00045 // The remainder of this code has been lifted from IORManipulation.cpp 00046 CORBA::String_var id = 00047 CORBA::string_dup (object->_stubobj ()->type_id.in ()); 00048 00049 TAO_ORB_Core *orb_core = object->_stubobj ()->orb_core (); 00050 if (orb_core == 0) 00051 orb_core = TAO_ORB_Core_instance (); 00052 00053 TAO_Stub *stub = orb_core->create_stub (id.in (), // give the id string to stub 00054 new_profiles); 00055 00056 // Make the stub memory allocation exception safe for the duration 00057 // of this method. 00058 TAO_Stub_Auto_Ptr safe_stub (stub); 00059 00060 // Create the CORBA level proxy 00061 CORBA::Object_ptr temp_obj = CORBA::Object::_nil (); 00062 ACE_NEW_THROW_EX (temp_obj, 00063 CORBA::Object (safe_stub.get ()), 00064 CORBA::NO_MEMORY ()); 00065 00066 CORBA::Object_var new_obj = temp_obj; 00067 00068 00069 // Clean up in case of errors. 00070 if (CORBA::is_nil (new_obj.in ())) 00071 { 00072 throw TAO_IOP::Invalid_IOR (); 00073 } 00074 00075 // Release ownership of the pointers protected by the auto_ptrs since 00076 // they no longer need to be protected by this point. 00077 stub = safe_stub.release (); 00078 00079 return new_obj._retn (); 00080 }
CORBA::Object_ptr TAO_IORManip_Filter::sanitize_profiles | ( | CORBA::Object_ptr | object, | |
TAO_Profile * | profile = 0 | |||
) |
Perform filtering using the profile passed in as a guide. If no profile is provided, filter using the profile_matches() method.
Definition at line 24 of file IORManip_Filter.cpp.
References sanitize().
00026 { 00027 return this->sanitize (object, profile); 00028 }