00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #include "DataReaderRemoteImpl.h" 00009 #include "dds/DCPS/DataReaderCallbacks.h" 00010 #include "dds/DCPS/GuidConverter.h" 00011 00012 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00013 00014 namespace OpenDDS { 00015 namespace DCPS { 00016 00017 DataReaderRemoteImpl::DataReaderRemoteImpl(DataReaderCallbacks& parent) 00018 : parent_(parent) 00019 { 00020 } 00021 00022 // This method is called when there are no longer any reference to the 00023 // the servant. 00024 DataReaderRemoteImpl::~DataReaderRemoteImpl() 00025 { 00026 } 00027 00028 void 00029 DataReaderRemoteImpl::detach_parent() 00030 { 00031 } 00032 00033 void 00034 DataReaderRemoteImpl::add_association(const RepoId& yourId, 00035 const WriterAssociation& writer, 00036 bool active) 00037 { 00038 if (DCPS_debug_level) { 00039 GuidConverter writer_converter(yourId); 00040 GuidConverter reader_converter(writer.writerId); 00041 ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) DataReaderRemoteImpl::add_association - ") 00042 ACE_TEXT("local %C remote %C\n"), 00043 std::string(writer_converter).c_str(), 00044 std::string(reader_converter).c_str())); 00045 } 00046 00047 // the local copy of parent_ is necessary to prevent race condition 00048 RcHandle<DataReaderCallbacks> parent = parent_.lock(); 00049 if (parent.in()) { 00050 parent->add_association(yourId, writer, active); 00051 } 00052 } 00053 00054 void 00055 DataReaderRemoteImpl::association_complete(const RepoId& remote_id) 00056 { 00057 // the local copy of parent_ is necessary to prevent race condition 00058 RcHandle<DataReaderCallbacks> parent = parent_.lock(); 00059 if (parent.in()) { 00060 parent->association_complete(remote_id); 00061 } 00062 } 00063 00064 void 00065 DataReaderRemoteImpl::remove_associations(const WriterIdSeq& writers, 00066 CORBA::Boolean notify_lost) 00067 { 00068 // the local copy of parent_ is necessary to prevent race condition 00069 RcHandle<DataReaderCallbacks> parent = parent_.lock(); 00070 if (parent.in()) { 00071 parent->remove_associations(writers, notify_lost); 00072 } 00073 } 00074 00075 void 00076 DataReaderRemoteImpl::update_incompatible_qos( 00077 const IncompatibleQosStatus& status) 00078 { 00079 // the local copy of parent_ is necessary to prevent race condition 00080 RcHandle<DataReaderCallbacks> parent = parent_.lock(); 00081 if (parent.in()) { 00082 parent->update_incompatible_qos(status); 00083 } 00084 } 00085 00086 } // namespace DCPS 00087 } // namespace OpenDDS 00088 00089 OPENDDS_END_VERSIONED_NAMESPACE_DECL