qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Member Functions | Private Attributes | List of all members
CoreExt::Packet Class Reference

#include <coreext.h>

Inheritance diagram for CoreExt::Packet:
Inheritance graph
Collaboration diagram for CoreExt::Packet:
Collaboration graph

Public Member Functions

 Packet (ToxExtPacketList *packetList, ToxExtensionMessages *toxExtMessages, uint32_t friendId, std::mutex *toxext_mutex, PacketPassKey)
 Internal constructor for a packet. More...
 
 Packet (Packet const &other)=delete
 
 Packet (Packet &&other)
 
uint64_t addExtendedMessage (QString message) override
 Adds message to packet. More...
 
bool send () override
 Consumes the packet constructed with PacketBuilder packet and sends it to toxext. More...
 
- Public Member Functions inherited from ICoreExtPacket
 ICoreExtPacket ()=default
 
virtual ~ICoreExtPacket ()
 
 ICoreExtPacket (const ICoreExtPacket &)=default
 
ICoreExtPacketoperator= (const ICoreExtPacket &)=default
 
 ICoreExtPacket (ICoreExtPacket &&)=default
 
ICoreExtPacketoperator= (ICoreExtPacket &&)=default
 

Private Attributes

std::mutex * toxext_mutex
 
bool hasBeenSent = false
 
ToxExtensionMessages * toxExtMessages
 
ToxExtPacketList * packetList
 
uint32_t friendId
 

Detailed Description

See documentation of ICoreExtPacket

Definition at line 80 of file coreext.h.

Constructor & Destructor Documentation

◆ Packet() [1/3]

CoreExt::Packet::Packet ( ToxExtPacketList *  packetList,
ToxExtensionMessages *  toxExtMessages,
uint32_t  friendId,
std::mutex *  toxext_mutex,
PacketPassKey   
)

Internal constructor for a packet.

Definition at line 74 of file coreext.cpp.

◆ Packet() [2/3]

CoreExt::Packet::Packet ( Packet const &  other)
delete

◆ Packet() [3/3]

CoreExt::Packet::Packet ( Packet &&  other)
inline

Definition at line 96 of file coreext.h.

Member Function Documentation

◆ addExtendedMessage()

uint64_t CoreExt::Packet::addExtendedMessage ( QString  message)
overridevirtual

Adds message to packet.

Returns
Extended message receipt, UINT64_MAX on failure
Note
Any other extensions related to this message have to be added before the message itself

Implements ICoreExtPacket.

Definition at line 98 of file coreext.cpp.

Here is the call graph for this function:

◆ send()

bool CoreExt::Packet::send ( )
overridevirtual

Consumes the packet constructed with PacketBuilder packet and sends it to toxext.

Implements ICoreExtPacket.

Definition at line 138 of file coreext.cpp.

Member Data Documentation

◆ friendId

uint32_t CoreExt::Packet::friendId
private

Definition at line 120 of file coreext.h.

◆ hasBeenSent

bool CoreExt::Packet::hasBeenSent = false
private

Definition at line 115 of file coreext.h.

◆ packetList

ToxExtPacketList* CoreExt::Packet::packetList
private

Definition at line 119 of file coreext.h.

◆ toxext_mutex

std::mutex* CoreExt::Packet::toxext_mutex
private

Definition at line 114 of file coreext.h.

◆ toxExtMessages

ToxExtensionMessages* CoreExt::Packet::toxExtMessages
private

Definition at line 117 of file coreext.h.


The documentation for this class was generated from the following files: