GSDFPacketDcps_impl.cpp
Go to the documentation of this file.
00001 #include "opensplice_dds_broker/GSDFPacketDcps_impl.h"
00002 #include "gapi.h"
00003 #include "gapi_loanRegistry.h"
00004 #include "opensplice_dds_broker/GSDFPacketSplDcps.h"
00005 #include "ccpp_DataReader_impl.h"
00006 #include "ccpp_DataReaderView_impl.h"
00007 
00008 
00009 extern c_bool
00010 __opensplice_dds_broker_GSDFPacket__copyIn(
00011     c_base base,
00012     struct opensplice_dds_broker::GSDFPacket *from,
00013     struct _opensplice_dds_broker_GSDFPacket *to);
00014 
00015 extern void
00016 __opensplice_dds_broker_GSDFPacket__copyOut(
00017     void *_from,
00018     void *_to);
00019 
00020 // DDS opensplice_dds_broker::GSDFPacket TypeSupportFactory Object Body
00021 
00022 ::DDS::DataWriter_ptr
00023 opensplice_dds_broker::GSDFPacketTypeSupportFactory::create_datawriter (gapi_dataWriter handle)
00024 {
00025     return new opensplice_dds_broker::GSDFPacketDataWriter_impl(handle);
00026 }
00027 
00028 ::DDS::DataReader_ptr
00029 opensplice_dds_broker::GSDFPacketTypeSupportFactory::create_datareader (gapi_dataReader handle)
00030 {
00031     return new opensplice_dds_broker::GSDFPacketDataReader_impl (handle);
00032 }
00033 
00034 
00035 ::DDS::DataReaderView_ptr
00036 opensplice_dds_broker::GSDFPacketTypeSupportFactory::create_view (gapi_dataReaderView handle)
00037 {
00038     return new opensplice_dds_broker::GSDFPacketDataReaderView_impl (handle);
00039 }
00040 
00041 // DDS opensplice_dds_broker::GSDFPacket TypeSupport Object Body
00042 
00043 opensplice_dds_broker::GSDFPacketTypeSupport::GSDFPacketTypeSupport(void) :
00044     TypeSupport_impl(
00045         __opensplice_dds_broker_GSDFPacket__name(),
00046         __opensplice_dds_broker_GSDFPacket__keys(),
00047         opensplice_dds_broker::GSDFPacketTypeSupport::metaDescriptor,
00048         (gapi_copyIn) __opensplice_dds_broker_GSDFPacket__copyIn,
00049         (gapi_copyOut) __opensplice_dds_broker_GSDFPacket__copyOut,
00050         (gapi_readerCopy) ::DDS::ccpp_DataReaderCopy<opensplice_dds_broker::GSDFPacketSeq, opensplice_dds_broker::GSDFPacket>,
00051         new  opensplice_dds_broker::GSDFPacketTypeSupportFactory(),
00052         opensplice_dds_broker::GSDFPacketTypeSupport::metaDescriptorArrLength)
00053 {
00054     // Parent constructor takes care of everything.
00055 }
00056 
00057 opensplice_dds_broker::GSDFPacketTypeSupport::~GSDFPacketTypeSupport(void)
00058 {
00059     // Parent destructor takes care of everything.
00060 }
00061 
00062 ::DDS::ReturnCode_t
00063 opensplice_dds_broker::GSDFPacketTypeSupport::register_type(
00064     ::DDS::DomainParticipant_ptr domain,
00065     const char * type_name) THROW_ORB_EXCEPTIONS
00066 {
00067     return TypeSupport_impl::register_type(domain, type_name);
00068 }
00069 
00070 char *
00071 opensplice_dds_broker::GSDFPacketTypeSupport::get_type_name() THROW_ORB_EXCEPTIONS
00072 {
00073     return TypeSupport_impl::get_type_name();
00074 }
00075 
00076 // DDS opensplice_dds_broker::GSDFPacket DataWriter_impl Object Body
00077 
00078 opensplice_dds_broker::GSDFPacketDataWriter_impl::GSDFPacketDataWriter_impl (
00079     gapi_dataWriter handle
00080 ) : ::DDS::DataWriter_impl(handle)
00081 {
00082     // Parent constructor takes care of everything.
00083 }
00084 
00085 opensplice_dds_broker::GSDFPacketDataWriter_impl::~GSDFPacketDataWriter_impl(void)
00086 {
00087     // Parent destructor takes care of everything.
00088 }
00089 
00090 ::DDS::InstanceHandle_t
00091 opensplice_dds_broker::GSDFPacketDataWriter_impl::register_instance(
00092     const opensplice_dds_broker::GSDFPacket & instance_data) THROW_ORB_EXCEPTIONS
00093 {
00094     return DataWriter_impl::register_instance(&instance_data);
00095 }
00096 
00097 ::DDS::InstanceHandle_t
00098 opensplice_dds_broker::GSDFPacketDataWriter_impl::register_instance_w_timestamp(
00099     const GSDFPacket & instance_data,
00100     const ::DDS::Time_t & source_timestamp) THROW_ORB_EXCEPTIONS
00101 {
00102     return DataWriter_impl::register_instance_w_timestamp(&instance_data, source_timestamp);
00103 }
00104 
00105 ::DDS::ReturnCode_t
00106 opensplice_dds_broker::GSDFPacketDataWriter_impl::unregister_instance(
00107     const opensplice_dds_broker::GSDFPacket & instance_data,
00108     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00109 {
00110     return DataWriter_impl::unregister_instance(&instance_data, handle);
00111 }
00112 
00113 ::DDS::ReturnCode_t
00114 opensplice_dds_broker::GSDFPacketDataWriter_impl::unregister_instance_w_timestamp(
00115     const GSDFPacket & instance_data,
00116     ::DDS::InstanceHandle_t handle,
00117     const ::DDS::Time_t & source_timestamp) THROW_ORB_EXCEPTIONS
00118 {
00119     return DataWriter_impl::unregister_instance_w_timestamp(&instance_data, handle, source_timestamp);
00120 }
00121 
00122 ::DDS::ReturnCode_t
00123 opensplice_dds_broker::GSDFPacketDataWriter_impl::write(
00124     const opensplice_dds_broker::GSDFPacket & instance_data,
00125     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00126 {
00127     return DataWriter_impl::write(&instance_data, handle);
00128 }
00129 
00130 ::DDS::ReturnCode_t
00131 opensplice_dds_broker::GSDFPacketDataWriter_impl::write_w_timestamp(
00132     const GSDFPacket & instance_data,
00133     ::DDS::InstanceHandle_t handle,
00134     const ::DDS::Time_t & source_timestamp) THROW_ORB_EXCEPTIONS
00135 {
00136     return DataWriter_impl::write_w_timestamp(&instance_data, handle, source_timestamp);
00137 }
00138 
00139 ::DDS::ReturnCode_t
00140 opensplice_dds_broker::GSDFPacketDataWriter_impl::dispose(
00141     const opensplice_dds_broker::GSDFPacket & instance_data,
00142     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00143 {
00144     return DataWriter_impl::dispose(&instance_data, handle);
00145 }
00146 
00147 ::DDS::ReturnCode_t
00148 opensplice_dds_broker::GSDFPacketDataWriter_impl::dispose_w_timestamp(
00149     const GSDFPacket & instance_data,
00150     ::DDS::InstanceHandle_t handle,
00151     const ::DDS::Time_t & source_timestamp) THROW_ORB_EXCEPTIONS
00152 {
00153     return DataWriter_impl::dispose_w_timestamp(&instance_data, handle, source_timestamp);
00154 }
00155 
00156 ::DDS::ReturnCode_t
00157 opensplice_dds_broker::GSDFPacketDataWriter_impl::writedispose(
00158     const opensplice_dds_broker::GSDFPacket & instance_data,
00159     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00160 {
00161     return DataWriter_impl::writedispose(&instance_data, handle);
00162 }
00163 
00164 ::DDS::ReturnCode_t
00165 opensplice_dds_broker::GSDFPacketDataWriter_impl::writedispose_w_timestamp(
00166     const GSDFPacket & instance_data,
00167     ::DDS::InstanceHandle_t handle,
00168     const ::DDS::Time_t & source_timestamp) THROW_ORB_EXCEPTIONS
00169 {
00170     return DataWriter_impl::writedispose_w_timestamp(&instance_data, handle, source_timestamp);
00171 }
00172 
00173 ::DDS::ReturnCode_t
00174 opensplice_dds_broker::GSDFPacketDataWriter_impl::get_key_value(
00175     GSDFPacket & key_holder,
00176     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00177 {
00178     return DataWriter_impl::get_key_value(&key_holder, handle);
00179 }
00180 
00181 ::DDS::InstanceHandle_t
00182 opensplice_dds_broker::GSDFPacketDataWriter_impl::lookup_instance(
00183     const opensplice_dds_broker::GSDFPacket & instance_data) THROW_ORB_EXCEPTIONS
00184 {
00185     return DataWriter_impl::lookup_instance(&instance_data);
00186 }
00187 
00188 // DDS opensplice_dds_broker::GSDFPacket DataReader_impl Object Body
00189 
00190 opensplice_dds_broker::GSDFPacketDataReader_impl::GSDFPacketDataReader_impl (
00191     gapi_dataReader handle
00192 ) : ::DDS::DataReader_impl(handle, ::DDS::ccpp_DataReaderParallelDemarshallingMain<opensplice_dds_broker::GSDFPacketSeq>)
00193 {
00194     // Parent constructor takes care of everything.
00195 }
00196 
00197 opensplice_dds_broker::GSDFPacketDataReader_impl::~GSDFPacketDataReader_impl(void)
00198 {
00199     // Parent destructor takes care of everything.
00200 }
00201 
00202 
00203 ::DDS::ReturnCode_t
00204 opensplice_dds_broker::GSDFPacketDataReader_impl::read(
00205     opensplice_dds_broker::GSDFPacketSeq & received_data,
00206     ::DDS::SampleInfoSeq & info_seq,
00207     ::DDS::Long max_samples,
00208     ::DDS::SampleStateMask sample_states,
00209     ::DDS::ViewStateMask view_states,
00210     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00211 {
00212     ::DDS::ReturnCode_t status;
00213 
00214     status = check_preconditions(received_data, info_seq, max_samples);
00215     if ( status == ::DDS::RETCODE_OK ) {
00216         status = DataReader_impl::read(&received_data, info_seq, max_samples, sample_states, view_states, instance_states);
00217     }
00218     return status;
00219 }
00220 
00221 ::DDS::ReturnCode_t
00222 opensplice_dds_broker::GSDFPacketDataReader_impl::take(
00223     opensplice_dds_broker::GSDFPacketSeq & received_data,
00224     ::DDS::SampleInfoSeq & info_seq,
00225     ::DDS::Long max_samples,
00226     ::DDS::SampleStateMask sample_states,
00227     ::DDS::ViewStateMask view_states,
00228     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00229 {
00230     ::DDS::ReturnCode_t status;
00231 
00232     status = check_preconditions(received_data, info_seq, max_samples);
00233     if ( status == ::DDS::RETCODE_OK ) {
00234         status = DataReader_impl::take(&received_data, info_seq, max_samples, sample_states, view_states, instance_states);
00235     }
00236     return status;
00237 }
00238 
00239 ::DDS::ReturnCode_t
00240 opensplice_dds_broker::GSDFPacketDataReader_impl::read_w_condition(
00241     opensplice_dds_broker::GSDFPacketSeq & received_data,
00242     ::DDS::SampleInfoSeq & info_seq,
00243     ::DDS::Long max_samples,
00244     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00245 {
00246     ::DDS::ReturnCode_t status;
00247 
00248     status = check_preconditions(received_data, info_seq, max_samples);
00249     if ( status == ::DDS::RETCODE_OK ) {
00250         status = DataReader_impl::read_w_condition(&received_data, info_seq, max_samples, a_condition);
00251     }
00252     return status;
00253 }
00254 
00255 ::DDS::ReturnCode_t
00256 opensplice_dds_broker::GSDFPacketDataReader_impl::take_w_condition(
00257     opensplice_dds_broker::GSDFPacketSeq & received_data,
00258     ::DDS::SampleInfoSeq & info_seq,
00259     ::DDS::Long max_samples,
00260     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00261 {
00262     ::DDS::ReturnCode_t status;
00263 
00264     status = check_preconditions(received_data, info_seq, max_samples);
00265     if ( status == ::DDS::RETCODE_OK ) {
00266         status = DataReader_impl::take_w_condition(&received_data, info_seq, max_samples, a_condition);
00267     }
00268     return status;
00269 }
00270 
00271 
00272 ::DDS::ReturnCode_t
00273 opensplice_dds_broker::GSDFPacketDataReader_impl::read_next_sample(
00274     opensplice_dds_broker::GSDFPacket & received_data,
00275     ::DDS::SampleInfo & sample_info) THROW_ORB_EXCEPTIONS
00276 {
00277     return DataReader_impl::read_next_sample(&received_data, sample_info);
00278 }
00279 
00280 
00281 ::DDS::ReturnCode_t
00282 opensplice_dds_broker::GSDFPacketDataReader_impl::take_next_sample(
00283     opensplice_dds_broker::GSDFPacket & received_data,
00284     ::DDS::SampleInfo & sample_info) THROW_ORB_EXCEPTIONS
00285 {
00286     return DataReader_impl::take_next_sample(&received_data, sample_info);
00287 }
00288 
00289 
00290 ::DDS::ReturnCode_t
00291 opensplice_dds_broker::GSDFPacketDataReader_impl::read_instance(
00292     opensplice_dds_broker::GSDFPacketSeq & received_data,
00293     ::DDS::SampleInfoSeq & info_seq,
00294     ::DDS::Long max_samples,
00295     ::DDS::InstanceHandle_t a_handle,
00296     ::DDS::SampleStateMask sample_states,
00297     ::DDS::ViewStateMask view_states,
00298     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00299 {
00300     ::DDS::ReturnCode_t status;
00301 
00302     status = check_preconditions(received_data, info_seq, max_samples);
00303     if ( status == ::DDS::RETCODE_OK ) {
00304         status = DataReader_impl::read_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00305     }
00306     return status;
00307 }
00308 
00309 ::DDS::ReturnCode_t
00310 opensplice_dds_broker::GSDFPacketDataReader_impl::take_instance(
00311     opensplice_dds_broker::GSDFPacketSeq & received_data,
00312     ::DDS::SampleInfoSeq & info_seq,
00313     ::DDS::Long max_samples,
00314     ::DDS::InstanceHandle_t a_handle,
00315     ::DDS::SampleStateMask sample_states,
00316     ::DDS::ViewStateMask view_states,
00317     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00318 {
00319     ::DDS::ReturnCode_t status;
00320 
00321     status = check_preconditions(received_data, info_seq, max_samples);
00322     if ( status == ::DDS::RETCODE_OK ) {
00323         status = DataReader_impl::take_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00324     }
00325     return status;
00326 }
00327 
00328 ::DDS::ReturnCode_t
00329 opensplice_dds_broker::GSDFPacketDataReader_impl::read_next_instance(
00330     opensplice_dds_broker::GSDFPacketSeq & received_data,
00331     ::DDS::SampleInfoSeq & info_seq,
00332     ::DDS::Long max_samples,
00333     ::DDS::InstanceHandle_t a_handle,
00334     ::DDS::SampleStateMask sample_states,
00335     ::DDS::ViewStateMask view_states,
00336     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00337 {
00338     ::DDS::ReturnCode_t status;
00339 
00340     status = check_preconditions(received_data, info_seq, max_samples);
00341     if ( status == ::DDS::RETCODE_OK ) {
00342         status = DataReader_impl::read_next_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00343     }
00344     return status;
00345 }
00346 
00347 ::DDS::ReturnCode_t
00348 opensplice_dds_broker::GSDFPacketDataReader_impl::take_next_instance(
00349     opensplice_dds_broker::GSDFPacketSeq & received_data,
00350     ::DDS::SampleInfoSeq & info_seq,
00351     ::DDS::Long max_samples,
00352     ::DDS::InstanceHandle_t a_handle,
00353     ::DDS::SampleStateMask sample_states,
00354     ::DDS::ViewStateMask view_states,
00355     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00356 {
00357     ::DDS::ReturnCode_t status;
00358 
00359     status = check_preconditions(received_data, info_seq, max_samples);
00360     if ( status == ::DDS::RETCODE_OK ) {
00361         status = DataReader_impl::take_next_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00362     }
00363     return status;
00364 }
00365 
00366 
00367 ::DDS::ReturnCode_t
00368 opensplice_dds_broker::GSDFPacketDataReader_impl::read_next_instance_w_condition(
00369     opensplice_dds_broker::GSDFPacketSeq & received_data,
00370     ::DDS::SampleInfoSeq & info_seq,
00371     ::DDS::Long max_samples,
00372     ::DDS::InstanceHandle_t a_handle,
00373     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00374 {
00375     ::DDS::ReturnCode_t status;
00376 
00377     status = check_preconditions(received_data, info_seq, max_samples);
00378     if ( status == ::DDS::RETCODE_OK ) {
00379         status = DataReader_impl::read_next_instance_w_condition(&received_data, info_seq, max_samples, a_handle, a_condition);
00380     }
00381     return status;
00382 }
00383 
00384 
00385 ::DDS::ReturnCode_t
00386 opensplice_dds_broker::GSDFPacketDataReader_impl::take_next_instance_w_condition(
00387     opensplice_dds_broker::GSDFPacketSeq & received_data,
00388     ::DDS::SampleInfoSeq & info_seq,
00389     ::DDS::Long max_samples,
00390     ::DDS::InstanceHandle_t a_handle,
00391     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00392 {
00393     ::DDS::ReturnCode_t status;
00394 
00395     status = check_preconditions(received_data, info_seq, max_samples);
00396     if ( status == ::DDS::RETCODE_OK ) {
00397         status = DataReader_impl::take_next_instance_w_condition(&received_data, info_seq, max_samples, a_handle, a_condition);
00398     }
00399     return status;
00400 }
00401 
00402 
00403 ::DDS::ReturnCode_t
00404 opensplice_dds_broker::GSDFPacketDataReader_impl::return_loan(
00405     opensplice_dds_broker::GSDFPacketSeq & received_data,
00406     ::DDS::SampleInfoSeq & info_seq) THROW_ORB_EXCEPTIONS
00407 {
00408     ::DDS::ReturnCode_t status = ::DDS::RETCODE_OK;
00409 
00410     if ( received_data.length() > 0 ) {
00411         if (received_data.length() == info_seq.length() &&
00412             received_data.release() == info_seq.release() ) {
00413             if (!received_data.release()) {
00414                 status = DataReader_impl::return_loan( received_data.get_buffer(),
00415                                                        info_seq.get_buffer() );
00416 
00417                 if ( status == ::DDS::RETCODE_OK ) {
00418                     if ( !received_data.release() ) {
00419                         opensplice_dds_broker::GSDFPacketSeq::freebuf( received_data.get_buffer(false) );
00420                         received_data.replace(0, 0, NULL, false);
00421                         ::DDS::SampleInfoSeq::freebuf( info_seq.get_buffer(false) );
00422                         info_seq.replace(0, 0, NULL, false);
00423                     }
00424                 } else if ( status == ::DDS::RETCODE_NO_DATA ) {
00425                     if ( received_data.release() ) {
00426                         status = ::DDS::RETCODE_OK;
00427                     } else {
00428                         status = ::DDS::RETCODE_PRECONDITION_NOT_MET;
00429                     }
00430                 }
00431             }
00432         } else {
00433             status = ::DDS::RETCODE_PRECONDITION_NOT_MET;
00434         }
00435     }
00436     return status;
00437 }
00438 
00439 
00440 ::DDS::ReturnCode_t
00441 opensplice_dds_broker::GSDFPacketDataReader_impl::get_key_value(
00442     opensplice_dds_broker::GSDFPacket & key_holder,
00443     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00444 {
00445     return DataReader_impl::get_key_value(&key_holder, handle);
00446 }
00447 
00448 ::DDS::InstanceHandle_t
00449 opensplice_dds_broker::GSDFPacketDataReader_impl::lookup_instance(
00450     const opensplice_dds_broker::GSDFPacket & instance) THROW_ORB_EXCEPTIONS
00451 {
00452     return DataReader_impl::lookup_instance(&instance);
00453 }
00454 
00455 ::DDS::ReturnCode_t
00456 opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(
00457     opensplice_dds_broker::GSDFPacketSeq & received_data,
00458     ::DDS::SampleInfoSeq & info_seq,
00459     ::DDS::Long max_samples)
00460 {
00461     ::DDS::ReturnCode_t status = ::DDS::RETCODE_PRECONDITION_NOT_MET;
00462 
00463     if ( received_data.length() == info_seq.length() &&
00464          received_data.maximum() == info_seq.maximum() &&
00465          received_data.release() == info_seq.release() ) {
00466         if ( received_data.maximum() == 0 || received_data.release() ) {
00467             if (received_data.maximum() == 0 ||
00468                 max_samples <= static_cast<DDS::Long>(received_data.maximum()) ||
00469                 max_samples == ::DDS::LENGTH_UNLIMITED ) {
00470                 status = ::DDS::RETCODE_OK;
00471             }
00472         }
00473     }
00474     return status;
00475 }
00476 
00477 
00478 // DDS opensplice_dds_broker::GSDFPacket DataReaderView_impl Object Body
00479 
00480 opensplice_dds_broker::GSDFPacketDataReaderView_impl::GSDFPacketDataReaderView_impl (
00481     gapi_dataReaderView handle
00482 ) : ::DDS::DataReaderView_impl(handle)
00483 {
00484     // Parent constructor takes care of everything.
00485 }
00486 
00487 opensplice_dds_broker::GSDFPacketDataReaderView_impl::~GSDFPacketDataReaderView_impl(void)
00488 {
00489     // Parent destructor takes care of everything.
00490 }
00491 
00492 
00493 ::DDS::ReturnCode_t
00494 opensplice_dds_broker::GSDFPacketDataReaderView_impl::read(
00495     opensplice_dds_broker::GSDFPacketSeq & received_data,
00496     ::DDS::SampleInfoSeq & info_seq,
00497     ::DDS::Long max_samples,
00498     ::DDS::SampleStateMask sample_states,
00499     ::DDS::ViewStateMask view_states,
00500     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00501 {
00502     ::DDS::ReturnCode_t status;
00503 
00504     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00505     if ( status == ::DDS::RETCODE_OK ) {
00506         status = DataReaderView_impl::read(&received_data, info_seq, max_samples, sample_states, view_states, instance_states);
00507     }
00508     return status;
00509 }
00510 
00511 ::DDS::ReturnCode_t
00512 opensplice_dds_broker::GSDFPacketDataReaderView_impl::take(
00513     opensplice_dds_broker::GSDFPacketSeq & received_data,
00514     ::DDS::SampleInfoSeq & info_seq,
00515     ::DDS::Long max_samples,
00516     ::DDS::SampleStateMask sample_states,
00517     ::DDS::ViewStateMask view_states,
00518     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00519 {
00520     ::DDS::ReturnCode_t status;
00521 
00522     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00523     if ( status == ::DDS::RETCODE_OK ) {
00524         status = DataReaderView_impl::take(&received_data, info_seq, max_samples, sample_states, view_states, instance_states);
00525     }
00526     return status;
00527 }
00528 
00529 ::DDS::ReturnCode_t
00530 opensplice_dds_broker::GSDFPacketDataReaderView_impl::read_w_condition(
00531     opensplice_dds_broker::GSDFPacketSeq & received_data,
00532     ::DDS::SampleInfoSeq & info_seq,
00533     ::DDS::Long max_samples,
00534     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00535 {
00536     ::DDS::ReturnCode_t status;
00537 
00538     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00539     if ( status == ::DDS::RETCODE_OK ) {
00540         status = DataReaderView_impl::read_w_condition(&received_data, info_seq, max_samples, a_condition);
00541     }
00542     return status;
00543 }
00544 
00545 ::DDS::ReturnCode_t
00546 opensplice_dds_broker::GSDFPacketDataReaderView_impl::take_w_condition(
00547     opensplice_dds_broker::GSDFPacketSeq & received_data,
00548     ::DDS::SampleInfoSeq & info_seq,
00549     ::DDS::Long max_samples,
00550     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00551 {
00552     ::DDS::ReturnCode_t status;
00553 
00554     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00555     if ( status == ::DDS::RETCODE_OK ) {
00556         status = DataReaderView_impl::take_w_condition(&received_data, info_seq, max_samples, a_condition);
00557     }
00558     return status;
00559 }
00560 
00561 
00562 ::DDS::ReturnCode_t
00563 opensplice_dds_broker::GSDFPacketDataReaderView_impl::read_next_sample(
00564     opensplice_dds_broker::GSDFPacket & received_data,
00565     ::DDS::SampleInfo & sample_info) THROW_ORB_EXCEPTIONS
00566 {
00567     return DataReaderView_impl::read_next_sample(&received_data, sample_info);
00568 }
00569 
00570 
00571 ::DDS::ReturnCode_t
00572 opensplice_dds_broker::GSDFPacketDataReaderView_impl::take_next_sample(
00573     opensplice_dds_broker::GSDFPacket & received_data,
00574     ::DDS::SampleInfo & sample_info) THROW_ORB_EXCEPTIONS
00575 {
00576     return DataReaderView_impl::take_next_sample(&received_data, sample_info);
00577 }
00578 
00579 
00580 ::DDS::ReturnCode_t
00581 opensplice_dds_broker::GSDFPacketDataReaderView_impl::read_instance(
00582     opensplice_dds_broker::GSDFPacketSeq & received_data,
00583     ::DDS::SampleInfoSeq & info_seq,
00584     ::DDS::Long max_samples,
00585     ::DDS::InstanceHandle_t a_handle,
00586     ::DDS::SampleStateMask sample_states,
00587     ::DDS::ViewStateMask view_states,
00588     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00589 {
00590     ::DDS::ReturnCode_t status;
00591 
00592     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00593     if ( status == ::DDS::RETCODE_OK ) {
00594         status = DataReaderView_impl::read_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00595     }
00596     return status;
00597 }
00598 
00599 ::DDS::ReturnCode_t
00600 opensplice_dds_broker::GSDFPacketDataReaderView_impl::take_instance(
00601     opensplice_dds_broker::GSDFPacketSeq & received_data,
00602     ::DDS::SampleInfoSeq & info_seq,
00603     ::DDS::Long max_samples,
00604     ::DDS::InstanceHandle_t a_handle,
00605     ::DDS::SampleStateMask sample_states,
00606     ::DDS::ViewStateMask view_states,
00607     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00608 {
00609     ::DDS::ReturnCode_t status;
00610 
00611     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00612     if ( status == ::DDS::RETCODE_OK ) {
00613         status = DataReaderView_impl::take_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00614     }
00615     return status;
00616 }
00617 
00618 ::DDS::ReturnCode_t
00619 opensplice_dds_broker::GSDFPacketDataReaderView_impl::read_next_instance(
00620     opensplice_dds_broker::GSDFPacketSeq & received_data,
00621     ::DDS::SampleInfoSeq & info_seq,
00622     ::DDS::Long max_samples,
00623     ::DDS::InstanceHandle_t a_handle,
00624     ::DDS::SampleStateMask sample_states,
00625     ::DDS::ViewStateMask view_states,
00626     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00627 {
00628     ::DDS::ReturnCode_t status;
00629 
00630     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00631     if ( status == ::DDS::RETCODE_OK ) {
00632         status = DataReaderView_impl::read_next_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00633     }
00634     return status;
00635 }
00636 
00637 ::DDS::ReturnCode_t
00638 opensplice_dds_broker::GSDFPacketDataReaderView_impl::take_next_instance(
00639     opensplice_dds_broker::GSDFPacketSeq & received_data,
00640     ::DDS::SampleInfoSeq & info_seq,
00641     ::DDS::Long max_samples,
00642     ::DDS::InstanceHandle_t a_handle,
00643     ::DDS::SampleStateMask sample_states,
00644     ::DDS::ViewStateMask view_states,
00645     ::DDS::InstanceStateMask instance_states) THROW_ORB_EXCEPTIONS
00646 {
00647     ::DDS::ReturnCode_t status;
00648 
00649     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00650     if ( status == ::DDS::RETCODE_OK ) {
00651         status = DataReaderView_impl::take_next_instance(&received_data, info_seq, max_samples, a_handle, sample_states, view_states, instance_states);
00652     }
00653     return status;
00654 }
00655 
00656 
00657 ::DDS::ReturnCode_t
00658 opensplice_dds_broker::GSDFPacketDataReaderView_impl::read_next_instance_w_condition(
00659     opensplice_dds_broker::GSDFPacketSeq & received_data,
00660     ::DDS::SampleInfoSeq & info_seq,
00661     ::DDS::Long max_samples,
00662     ::DDS::InstanceHandle_t a_handle,
00663     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00664 {
00665     ::DDS::ReturnCode_t status;
00666 
00667     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00668     if ( status == ::DDS::RETCODE_OK ) {
00669         status = DataReaderView_impl::read_next_instance_w_condition(&received_data, info_seq, max_samples, a_handle, a_condition);
00670     }
00671     return status;
00672 }
00673 
00674 
00675 ::DDS::ReturnCode_t
00676 opensplice_dds_broker::GSDFPacketDataReaderView_impl::take_next_instance_w_condition(
00677     opensplice_dds_broker::GSDFPacketSeq & received_data,
00678     ::DDS::SampleInfoSeq & info_seq,
00679     ::DDS::Long max_samples,
00680     ::DDS::InstanceHandle_t a_handle,
00681     ::DDS::ReadCondition_ptr a_condition) THROW_ORB_EXCEPTIONS
00682 {
00683     ::DDS::ReturnCode_t status;
00684 
00685     status = opensplice_dds_broker::GSDFPacketDataReader_impl::check_preconditions(received_data, info_seq, max_samples);
00686     if ( status == ::DDS::RETCODE_OK ) {
00687         status = DataReaderView_impl::take_next_instance_w_condition(&received_data, info_seq, max_samples, a_handle, a_condition);
00688     }
00689     return status;
00690 }
00691 
00692 
00693 ::DDS::ReturnCode_t
00694 opensplice_dds_broker::GSDFPacketDataReaderView_impl::return_loan(
00695     opensplice_dds_broker::GSDFPacketSeq & received_data,
00696     ::DDS::SampleInfoSeq & info_seq) THROW_ORB_EXCEPTIONS
00697 {
00698     ::DDS::ReturnCode_t status = ::DDS::RETCODE_OK;
00699 
00700     if ( received_data.length() > 0 ) {
00701         if (received_data.length() == info_seq.length() &&
00702             received_data.release() == info_seq.release() ) {
00703             if (!received_data.release()) {
00704                 status = DataReaderView_impl::return_loan( received_data.get_buffer(),
00705                                                        info_seq.get_buffer() );
00706 
00707                 if ( status == ::DDS::RETCODE_OK ) {
00708                     if ( !received_data.release() ) {
00709                         opensplice_dds_broker::GSDFPacketSeq::freebuf( received_data.get_buffer(false) );
00710                         received_data.replace(0, 0, NULL, false);
00711                         ::DDS::SampleInfoSeq::freebuf( info_seq.get_buffer(false) );
00712                         info_seq.replace(0, 0, NULL, false);
00713                     }
00714                 } else if ( status == ::DDS::RETCODE_NO_DATA ) {
00715                     if ( received_data.release() ) {
00716                         status = ::DDS::RETCODE_OK;
00717                     } else {
00718                         status = ::DDS::RETCODE_PRECONDITION_NOT_MET;
00719                     }
00720                 }
00721             }
00722         } else {
00723             status = ::DDS::RETCODE_PRECONDITION_NOT_MET;
00724         }
00725     }
00726     return status;
00727 }
00728 
00729 
00730 ::DDS::ReturnCode_t
00731 opensplice_dds_broker::GSDFPacketDataReaderView_impl::get_key_value(
00732     opensplice_dds_broker::GSDFPacket & key_holder,
00733     ::DDS::InstanceHandle_t handle) THROW_ORB_EXCEPTIONS
00734 {
00735     return DataReaderView_impl::get_key_value(&key_holder, handle);
00736 }
00737 
00738 ::DDS::InstanceHandle_t
00739 opensplice_dds_broker::GSDFPacketDataReaderView_impl::lookup_instance(
00740     const opensplice_dds_broker::GSDFPacket & instance) THROW_ORB_EXCEPTIONS
00741 {
00742     return DataReaderView_impl::lookup_instance(&instance);
00743 }
00744 
00745 
00746 
00747 const char * ::opensplice_dds_broker::GSDFPacketTypeSupport::metaDescriptor[] = {"<MetaData version=\"1.0.0\"><Module name=\"opensplice_dds_broker\"><TypeDef name=\"CharSeq\"><Sequence>",
00748 "<Char/></Sequence></TypeDef><Struct name=\"GSDFPacket\"><Member name=\"data\"><Type name=\"CharSeq\"/>",
00749 "</Member></Struct></Module></MetaData>"};
00750 const ::DDS::ULong (::opensplice_dds_broker::GSDFPacketTypeSupport::metaDescriptorArrLength) = 3;


opensplice_dds_broker
Author(s):
autogenerated on Thu Jun 6 2019 18:52:31