12 #ifndef CXSOCKETCONNECTION_H 13 #define CXSOCKETCONNECTION_H 19 #include "boost/shared_ptr.hpp" 37 #define assertRunningInObjectThread() \ 39 if (QThread::currentThread()!=this->thread()) \ 42 << QString("Method should be called in the object's thread [%1] only, current thread = [%2]") \ 43 .arg(this->thread()->objectName()) \ 44 .arg(QThread::currentThread()->objectName()); \ 69 bool isServer()
const;
70 bool isClient()
const;
71 bool isLocalhostConnection()
const;
72 QString getDescription()
const;
83 virtual void requestConnect();
84 virtual void requestDisconnect();
86 bool socketReceive(
void *packPointer,
int packSize)
const;
89 bool sendData(
const char* data, qint64 maxSize);
92 void connectionInfoChanged();
100 void internalConnected();
101 void internalDisconnected();
102 void internalError(QAbstractSocket::SocketError socketError);
103 virtual void internalDataAvailable();
106 virtual void setProtocol(QString protocolname);
108 bool socketIsConnected();
109 bool enoughBytesAvailableOnSocket(
int bytes)
const;
110 QStringList getAllServerHostnames();
111 void setCurrentConnectionInfo();
127 #endif // CXSOCKETCONNECTION_H CX_SOCKETCONNECTION_STATE
ConnectionInfo mNextConnectionInfo
info to be used for the next connect(), mutexed.
SNW_DECLARE_ENUM_STRING_CONVERTERS(cxResource_EXPORT, cx, CX_SOCKETCONNECTION_STATE)
CX_SOCKETCONNECTION_STATE mCurrentState
boost::shared_ptr< class SocketConnection > SocketConnectionPtr
QMutex mNextConnectionInfoMutex
boost::shared_ptr< class SocketConnector > SocketConnectorPtr
bool operator==(const RegistrationTransform &lhs, const RegistrationTransform &rhs)
SocketConnectorPtr mConnector
Namespace for all CustusX production code.