Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
QH::DataSender Class Reference

The DataSender class this class create a queue for sendet data to network. More...

#include <datasender.h>

Inheritance diagram for QH::DataSender:
Inheritance graph
Collaboration diagram for QH::DataSender:
Collaboration graph

Public Member Functions

 DataSender (QThread *thread)
 
bool sendData (const QByteArray &array, void *target, bool await=false) const
 sendPackagePrivate This slot move send package to a main thread.
 
- Public Member Functions inherited from QH::Async
bool asyncLauncher (const Job &job, bool await=false, bool freaze=true) const
 asyncLauncher This method invoke a job on the thread (using the asyncHandler method) of this object.
 

Additional Inherited Members

- Public Types inherited from QH::Async
using Job = std::function< bool()>
 
- Protected Member Functions inherited from QH::Async
 Async (QThread *thread, QObject *ptr=nullptr)
 Async This is default constructor of the async object.
 
 ~Async ()
 
bool waitFor (bool *condition, int timeout=WAIT_TIME, bool freaze=true) const
 waitFor This is base wait function.
 
bool waitFor (const Job &condition, int timeout=WAIT_TIME, bool freaze=true) const
 waitFor This is base wait function.
 

Detailed Description

The DataSender class this class create a queue for sendet data to network.

Definition at line 22 of file datasender.h.

Constructor & Destructor Documentation

◆ DataSender()

QH::DataSender::DataSender ( QThread *  thread)

Definition at line 16 of file datasender.cpp.

Member Function Documentation

◆ sendData()

bool QH::DataSender::sendData ( const QByteArray &  array,
void *  target,
bool  await = false 
) const

sendPackagePrivate This slot move send package to a main thread.

Parameters
arrayBytes to send.
targetThis is pointer of target socket.
awaitThis option force wait for finishing data sending.

Definition at line 21 of file datasender.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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