Browse Source

CNodeRef copy constructor and assignment operator

pull/145/head
Patrick Strateman 9 years ago
committed by Taylor Hornby
parent
commit
75c0598cac
  1. 16
      src/net.cpp

16
src/net.cpp

@ -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;
};

Loading…
Cancel
Save