Browse Source

CNodeRef copy constructor and assignment operator

0.13
Patrick Strateman 9 years ago
parent
commit
69ee1aab00
  1. 16
      src/net.cpp

16
src/net.cpp

@ -782,6 +782,22 @@ public: @@ -782,6 +782,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