39 #ifndef ORO_CARRAY_HPP_ 40 #define ORO_CARRAY_HPP_ 42 #include <boost/version.hpp> 43 #if BOOST_VERSION >= 106400 47 # include <boost/serialization/array_wrapper.hpp> 49 # include <boost/serialization/array.hpp> 51 #include <boost/array.hpp> 88 carray(value_type* t, std::size_t s) :
99 carray() : m_t(0), m_element_count(0) {}
107 #if BOOST_VERSION >= 106100 108 carray( boost::serialization::array_wrapper<T>
const& orig)
110 carray( boost::serialization::array<T>
const& orig)
112 : m_t( orig.address() ), m_element_count( orig.count() ) {
113 if (m_element_count == 0)
123 template<std::
size_t N>
125 : m_t( orig.c_array() ), m_element_count( N ) {
126 if (m_element_count == 0)
133 void init(value_type* t, std::size_t s) {
152 return m_element_count;
161 template <
class OtherT>
164 for(std::size_t i = 0; i != orig.
count() && i !=
count(); ++i)
176 template <
class OtherT>
177 #if BOOST_VERSION >= 106100 178 const carray<T>&
operator=( boost::serialization::array_wrapper<OtherT>
const& orig ) {
182 if (orig.address() != m_t)
183 for(std::size_t i = 0; i != orig.count() && i !=
count(); ++i)
184 m_t[i] = orig.address()[i];
195 template <
class OtherT, std::
size_t OtherN>
197 if (orig.data() != m_t)
198 for(std::size_t i = 0; i != orig.size() && i !=
count(); ++i)
205 std::size_t m_element_count;
const carray< T > & operator=(boost::serialization::array< OtherT > const &orig)
Assignment only copies max(this->count(), orig.count()) elements from orig to this object...
carray(boost::serialization::array< T > const &orig)
We are constructible from boost::serialization::array<T> Makes a shallow copy in order to keep the re...
void init(value_type *t, std::size_t s)
(Re-)initialize this carray to a new address and size.
value_type * address() const
The address of the first element of the array.
Wraps a C array such that we can return a C array from a DataSource.
std::size_t count() const
carray()
Creates an empty carray.
const carray< T > & operator=(const carray< OtherT > &orig)
Assignment only copies max(this->count(), orig.count()) elements from orig to this object...
carray(boost::array< T, N > &orig)
We are constructible from boost::array<T,N> Makes a shallow copy in order to keep the reference to th...
carray(value_type *t, std::size_t s)
Create an C array wrapper.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
const carray< T > & operator=(const boost::array< OtherT, OtherN > &orig)
Assignment only copies max(this->count(), orig.size()) elements from orig to this object...