- LayerArray: added copy constructor

- minor changes

git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@42 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2014-10-26 08:46:13 +00:00
parent 376f2dfa35
commit 6520c80eca
3 changed files with 19 additions and 6 deletions
+16 -2
View File
@@ -72,6 +72,20 @@ public:
}
}
LayerArray (const LayerArray<T> &rhs)
: m_size(0)
, m_pRoot(nullptr)
, m_ppIndex(nullptr)
, m_pListener(nullptr)
{
uint32_t i;
for (i=0; i < rhs.getSize(); i++)
{
this->add(&rhs[i].states(), rhs[i].states().size());
}
}
virtual ~LayerArray()
{
m_pListener = nullptr;
@@ -125,12 +139,12 @@ public:
m_pListener->onChanged(*this);
}
T& getAt(uint32_t index)
T& getAt(uint32_t index) const
{
return *m_ppIndex[index];
}
T& operator[](uint32_t index)
T& operator[](uint32_t index) const
{
return getAt(index);
}