added: some work in MemBuffer (copy cctor and assignment operator)

git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@424 e52654a7-88a9-db11-a3e9-0013d4bc506e
master
Tomasz Sowa 11 years ago
parent 862dd01ea9
commit 64b05fe8d1

@ -39,7 +39,6 @@
#define headerfile_picotools_membuffer_membuffer
namespace PT
{
@ -106,8 +105,8 @@ public:
MemBuffer();
~MemBuffer();
//MemBuffer(const MemBuffer<ItemType, stack_size, heap_block_size> & arg);
//MemBuffer & operator=(const MemBuffer<ItemType, stack_size, heap_block_size> & arg);
MemBuffer(const MemBuffer<ItemType, stack_size, heap_block_size> & arg);
MemBuffer & operator=(const MemBuffer<ItemType, stack_size, heap_block_size> & arg);
void Append(ItemType item);
void Append(ItemType * item_array, size_t len);
@ -411,6 +410,30 @@ MemBuffer<ItemType, stack_size, heap_block_size>::~MemBuffer()
}
template<class ItemType, size_t stack_size, size_t heap_block_size>
MemBuffer<ItemType, stack_size, heap_block_size>::MemBuffer(const MemBuffer<ItemType, stack_size, heap_block_size> & arg)
{
operator=(arg);
}
template<class ItemType, size_t stack_size, size_t heap_block_size>
MemBuffer<ItemType, stack_size, heap_block_size> &
MemBuffer<ItemType, stack_size, heap_block_size>::operator=(const MemBuffer<ItemType, stack_size, heap_block_size> & arg)
{
if( size_used > 0 )
Clear();
ConstIterator i = arg.Begin();
for( ; i != arg.End() ; ++i)
Append(*i);
return *this;
}
template<class ItemType, size_t stack_size, size_t heap_block_size>
void MemBuffer<ItemType, stack_size, heap_block_size>::AddDynamicNode()
{

Loading…
Cancel
Save