Changeset 177:92c581db5581 in finroc_plugins_data_ports
- Timestamp:
- 25.03.2021 07:52:14 (4 weeks ago)
- Branch:
- 17.03
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
api/tGenericPortImplementation.h
r175 r177 183 183 * This publish()-variant is efficient with all data types. 184 184 */ 185 template <typename T> 186 inline void Publish(core::tAbstractPort& port, tPortDataPointer<T>& data_buffer) 185 inline void Publish(core::tAbstractPort& port, tPortDataPointer<rrlib::rtti::tGenericObject>& data_buffer) 187 186 { 188 187 if (IsCheaplyCopiedType(port.GetDataType())) … … 214 213 215 214 /*! 215 * Publish Data Buffer obtained from another port. This data will be forwarded to any connected ports. 216 * Should only be called on output ports. 217 * 218 * \param port Wrapped port to operate on 219 * \param data_buffer Data to publish. 220 * 221 * This publish()-variant is efficient with all data types. 222 */ 223 inline void PublishConstBuffer(core::tAbstractPort& port, tPortDataPointer<const rrlib::rtti::tGenericObject>& data_buffer) 224 { 225 if (IsCheaplyCopiedType(port.GetDataType())) 226 { 227 this->Publish(port, *data_buffer, data_buffer.GetTimestamp()); // copy and publish (as non-generic ports) 228 } 229 else 230 { 231 standard::tStandardPort::tLockingManagerPointer buffer(static_cast<standard::tPortBufferManager*>(data_buffer.implementation.Release())); 232 assert(!buffer->IsUnused()); 233 static_cast<standard::tStandardPort&>(port).Publish(buffer); 234 } 235 } 236 237 /*! 216 238 * Set new bounds 217 239 * (This is not thread-safe and must only be done in "pause mode") -
tGenericPort.h
r175 r177 314 314 inline void Publish(tPortDataPointer<const rrlib::rtti::tGenericObject>& buffer) 315 315 { 316 implementation->Publish (*GetWrapped(), buffer);316 implementation->PublishConstBuffer(*GetWrapped(), buffer); 317 317 } 318 318
Note: See TracChangeset
for help on using the changeset viewer.