diff --git a/include/ebcl/Buffers.hh b/include/ebcl/Buffers.hh index ae388d6..bb3229f 100644 --- a/include/ebcl/Buffers.hh +++ b/include/ebcl/Buffers.hh @@ -98,6 +98,7 @@ class T_Buffer : public T_BufferBase MyType_& resize( size_t newSize ); MyType_& setAll( T const& value ); MyType_& copyAll( T const* data ); + MyType_& append( T const* data , size_t size ); }; diff --git a/include/ebcl/inline/Buffers.hh b/include/ebcl/inline/Buffers.hh index bb58030..6aa0ee8 100644 --- a/include/ebcl/inline/Buffers.hh +++ b/include/ebcl/inline/Buffers.hh @@ -260,6 +260,20 @@ inline T_Buffer< T >& T_Buffer< T >::copyAll( T const* data ) return *this; } +template< typename T > +inline T_Buffer< T >& T_Buffer< T >::append( + T const* data , + size_t size ) +{ + if ( size != 0 ) { + const auto os{ size_ }; + resize( os + size ); + memcpy( data_ + os * sizeof( T ) , + data , size * sizeof( T ) ); + } + return *this; +} + } // namespace #endif // _H_EBCL_INLINE_BUFFERS