MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / write_w_timestamp

Method write_w_timestamp

dds/DCPS/DataWriterImpl.cpp:3190–3236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3188}
3189
3190DDS::ReturnCode_t DataWriterImpl::write_w_timestamp(
3191 const Sample& sample,
3192 DDS::InstanceHandle_t handle,
3193 const DDS::Time_t& source_timestamp)
3194{
3195 // This operation assumes the provided handle is valid. The handle provided
3196 // will not be verified.
3197
3198 if (handle == DDS::HANDLE_NIL) {
3199 DDS::InstanceHandle_t registered_handle = DDS::HANDLE_NIL;
3200 const DDS::ReturnCode_t ret =
3201 get_or_create_instance_handle(registered_handle, sample, source_timestamp);
3202 if (ret != DDS::RETCODE_OK) {
3203 if (log_level >= LogLevel::Notice) {
3204 ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: %CDataWriterImpl::write_w_timestamp: "
3205 "register failed: %C\n",
3206 get_type_support()->name(),
3207 retcode_to_string(ret)));
3208 }
3209 return ret;
3210 }
3211
3212 handle = registered_handle;
3213 }
3214
3215 // list of reader GUID_ts that should not get data
3216 GUIDSeq_var filter_out;
3217#ifndef OPENDDS_NO_CONTENT_FILTERED_TOPIC
3218 if (publisher_content_filter_) {
3219 ACE_GUARD_RETURN(ACE_Thread_Mutex, reader_info_guard, reader_info_lock_, DDS::RETCODE_ERROR);
3220 for (RepoIdToReaderInfoMap::iterator iter = reader_info_.begin(),
3221 end = reader_info_.end(); iter != end; ++iter) {
3222 const ReaderInfo& ri = iter->second;
3223 if (!ri.eval_.is_nil()) {
3224 if (!filter_out.ptr()) {
3225 filter_out = new OpenDDS::DCPS::GUIDSeq;
3226 }
3227 if (!sample.eval(*ri.eval_, ri.expression_params_)) {
3228 push_back(filter_out.inout(), iter->first);
3229 }
3230 }
3231 }
3232 }
3233#endif
3234
3235 return write_sample(sample, handle, source_timestamp, filter_out._retn());
3236}
3237
3238DDS::ReturnCode_t DataWriterImpl::write_sample(
3239 const Sample& sample,

Callers

nothing calls this directly

Calls 12

get_type_supportFunction · 0.85
retcode_to_stringFunction · 0.85
write_sampleFunction · 0.85
push_backFunction · 0.70
nameMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
is_nilMethod · 0.45
ptrMethod · 0.45
evalMethod · 0.45
inoutMethod · 0.45
_retnMethod · 0.45

Tested by

no test coverage detected