/* * Copyright(c) 2006 to 2020 ZettaScale Technology and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License * v. 1.0 which is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause */ #ifndef CYCLONEDDS_DDS_SUB_DETAIL_SHARED_SAMPLES_HPP_ #define CYCLONEDDS_DDS_SUB_DETAIL_SHARED_SAMPLES_HPP_ /** * @file */ #include // Implementation namespace dds { namespace sub { namespace detail { template class SharedSamples { public: typedef typename std::vector< dds::sub::Sample >::iterator iterator; typedef typename std::vector< dds::sub::Sample >::const_iterator const_iterator; public: SharedSamples() { } SharedSamples(dds::sub::LoanedSamples ls) : samples_(ls) { } ~SharedSamples() { } public: iterator mbegin() { return samples_->begin(); } const_iterator begin() const { return samples_.begin(); } const_iterator end() const { return samples_.end(); } uint32_t length() const { /** @internal @todo Possible RTF size issue ? */ return static_cast(samples_.length()); } void resize(uint32_t s) { samples_.resize(s); } private: dds::sub::LoanedSamples samples_; }; } } } // End of implementation #endif /* CYCLONEDDS_DDS_SUB_DETAIL_SHARED_SAMPLES_HPP_ */