mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 16:17:28 -04:00
Added rsshared ptr helper object (only use in test for memory management)
Added first nxs_test modified pserviceserver to allow better dependency injection git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7279 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a929f80596
commit
ef8f48ae73
17 changed files with 340 additions and 86 deletions
|
@ -1243,6 +1243,19 @@ std::ostream& RsNxsSyncMsgItem::print(std::ostream &out, uint16_t indent)
|
|||
return out;
|
||||
}
|
||||
|
||||
RsNxsGrp* RsNxsGrp::clone() const {
|
||||
RsNxsGrp* grp = new RsNxsGrp(PacketService());
|
||||
*grp = *this;
|
||||
|
||||
if(this->metaData)
|
||||
{
|
||||
grp->metaData = new RsGxsGrpMetaData();
|
||||
*(grp->metaData) = *(this->metaData);
|
||||
}
|
||||
|
||||
return grp;
|
||||
}
|
||||
|
||||
std::ostream& RsNxsGrp::print(std::ostream &out, uint16_t indent){
|
||||
|
||||
printRsItemBase(out, "RsNxsGrp", indent);
|
||||
|
|
|
@ -200,6 +200,8 @@ public:
|
|||
//std::cout << "\nGrp refcount-- : " << --refcount << std::endl;
|
||||
}
|
||||
|
||||
RsNxsGrp* clone() const;
|
||||
|
||||
virtual void clear();
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ uint8_t RsItem::PacketType()
|
|||
}
|
||||
|
||||
|
||||
uint8_t RsItem::PacketSubType()
|
||||
uint8_t RsItem::PacketSubType() const
|
||||
{
|
||||
return (type & 0xFF);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ RsItem::RsItem(uint8_t ver, uint16_t service, uint8_t subtype)
|
|||
return;
|
||||
}
|
||||
|
||||
uint16_t RsItem::PacketService()
|
||||
uint16_t RsItem::PacketService() const
|
||||
{
|
||||
return (type >> 8) & 0xFFFF;
|
||||
}
|
||||
|
|
|
@ -96,11 +96,11 @@ class RsItem: public RsMemoryManagement::SmallObject
|
|||
uint8_t PacketVersion();
|
||||
uint8_t PacketClass();
|
||||
uint8_t PacketType();
|
||||
uint8_t PacketSubType();
|
||||
uint8_t PacketSubType() const;
|
||||
|
||||
/* For Service Packets */
|
||||
RsItem(uint8_t ver, uint16_t service, uint8_t subtype);
|
||||
uint16_t PacketService(); /* combined Packet class/type (mid 16bits) */
|
||||
uint16_t PacketService() const; /* combined Packet class/type (mid 16bits) */
|
||||
|
||||
inline uint8_t priority_level() const { return _priority_level ;}
|
||||
inline void setPriorityLevel(uint8_t l) { _priority_level = l ;}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue