mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-11 15:48:05 +00:00
CNodeRef copy constructor and assignment operator
This commit is contained in:
parent
dc81dd02a1
commit
69ee1aab00
16
src/net.cpp
16
src/net.cpp
@ -782,6 +782,22 @@ public:
|
|||||||
|
|
||||||
CNode& operator *() const {return *_pnode;};
|
CNode& operator *() const {return *_pnode;};
|
||||||
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:
|
private:
|
||||||
CNode *_pnode;
|
CNode *_pnode;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user