CNodeRef copy constructor and assignment operator

This commit is contained in:
Patrick Strateman
2016-08-15 19:38:17 -06:00
committed by Taylor Hornby
parent ce94413e03
commit 75c0598cac
+16
View File
@@ -678,6 +678,22 @@ public:
CNode& operator *() const {return *_pnode;};
CNode* operator ->() const {return _pnode;};
CNodeRef& operator =(const CNodeRef& other)
{
if (this != &other) {
_pnode->Release();
_pnode = other._pnode;
_pnode->AddRef();
}
return *this;
}
CNodeRef(const CNodeRef& other):
_pnode(other._pnode)
{
_pnode->AddRef();
}
private:
CNode *_pnode;
};