15 #ifndef VISIONTRANSFER_ASYNCTRANSFER_H
16 #define VISIONTRANSFER_ASYNCTRANSFER_H
18 #include "visiontransfer/common.h"
19 #include "visiontransfer/types.h"
20 #include "visiontransfer/imagetransfer.h"
21 #include "visiontransfer/imageset.h"
22 #include "visiontransfer/imageprotocol.h"
23 #include "visiontransfer/deviceinfo.h"
25 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L
29 namespace visiontransfer {
38 class VT_EXPORT AsyncTransfer {
57 AsyncTransfer(
const char* address,
const char* service =
"7681",
59 bool server =
false,
int bufferSize = 16*1048576,
int maxUdpPacketSize = 1472,
60 int autoReconnectDelay=1);
72 AsyncTransfer(
const DeviceInfo& device,
int bufferSize = 16*1048576,
int maxUdpPacketSize = 1472,
73 int autoReconnectDelay=1);
90 void sendImageSetAsync(
const ImageSet& imageSet,
bool deleteData =
false);
92 #ifndef DOXYGEN_SHOULD_SKIP_THIS
93 DEPRECATED(
"Use sendImageSetAsync() instead")
94 inline
void sendImagePairAsync(const ImageSet& imageSet,
bool deleteData = false) {
95 sendImageSetAsync(imageSet, deleteData);
115 bool collectReceivedImageSet(ImageSet& imageSet,
double timeout = -1);
117 #ifndef DOXYGEN_SHOULD_SKIP_THIS
118 DEPRECATED(
"Use collectReceivedImageSet() instead")
119 inline
bool collectReceivedImagePair(ImageSet& imageSet,
double timeout = -1) {
120 return collectReceivedImageSet(imageSet, timeout);
131 int getNumDroppedFrames()
const;
147 bool isConnected()
const;
161 std::string getRemoteAddress()
const;
163 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L
168 void setConnectionStateChangeCallback(std::function<
void(visiontransfer::ConnectionState)> callback);
185 void setAutoReconnect(
int secondsBetweenRetries=1);
193 AsyncTransfer(
const AsyncTransfer& other);
194 AsyncTransfer& operator=(
const AsyncTransfer&);