51 lines
888 B
C++
51 lines
888 B
C++
#ifndef ZNODE_VECTOR_H
|
|
#define ZNODE_VECTOR_H
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
//using znode_vector = std::vector<zplain_node*>;
|
|
template<class T>
|
|
class znode_vector : public std::vector<T*>
|
|
{
|
|
|
|
public:
|
|
|
|
// FIX! implement this!
|
|
// why delete??
|
|
znode_vector() = default;
|
|
znode_vector(const znode_vector&) = delete;
|
|
znode_vector& operator=(const znode_vector&) = delete;
|
|
|
|
|
|
virtual ~znode_vector()
|
|
{
|
|
|
|
}
|
|
|
|
znode_vector* clone() const
|
|
{
|
|
znode_vector* new_list = new znode_vector;
|
|
clone_into( *new_list );
|
|
return new_list;
|
|
}
|
|
|
|
void clone_into( znode_vector& new_list ) const
|
|
{
|
|
new_list.clear();
|
|
for(const auto entry : *this )
|
|
new_list.push_back( entry->clone() );
|
|
}
|
|
|
|
void clone_from( const znode_vector& src_list )
|
|
{
|
|
this->clear();
|
|
for(const auto entry : src_list )
|
|
this->push_back( entry->clone() );
|
|
}
|
|
|
|
};
|
|
|
|
#endif // ZNODE_VECTOR_H
|