39 #ifndef ORO_CARRAY_HPP_ 40 #define ORO_CARRAY_HPP_ 42 #include <boost/version.hpp> 43 #include <boost/serialization/array.hpp> 44 #include <boost/array.hpp> 81 carray(value_type* t, std::size_t s) :
92 carray() : m_t(0), m_element_count(0) {}
100 #if BOOST_VERSION >= 106100 101 carray( boost::serialization::array_wrapper<T>
const& orig)
103 carray( boost::serialization::array<T>
const& orig)
105 : m_t( orig.address() ), m_element_count( orig.count() ) {
106 if (m_element_count == 0)
116 template<std::
size_t N>
118 : m_t( orig.c_array() ), m_element_count( N ) {
119 if (m_element_count == 0)
126 void init(value_type* t, std::size_t s) {
145 return m_element_count;
154 template <
class OtherT>
157 for(std::size_t i = 0; i != orig.
count() && i !=
count(); ++i)
169 template <
class OtherT>
170 #if BOOST_VERSION >= 106100 171 const carray<T>&
operator=( boost::serialization::array_wrapper<OtherT>
const& orig ) {
175 if (orig.address() != m_t)
176 for(std::size_t i = 0; i != orig.count() && i !=
count(); ++i)
177 m_t[i] = orig.address()[i];
188 template <
class OtherT, std::
size_t OtherN>
190 if (orig.data() != m_t)
191 for(std::size_t i = 0; i != orig.size() && i !=
count(); ++i)
198 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...