30 #include <QDataStream>
31 #include <QStringList>
32 #include <QLocalSocket>
43 void post( QIODevice* out )
46 out->write( (
const char* ) &temp,
sizeof( qint32 ) );
49 bool read( QLocalSocket* in )
51 while ( in->bytesAvailable() < ( int )
sizeof( qint32 ) ) {
52 if ( in->state() != QLocalSocket::ConnectedState )
54 in->waitForReadyRead( 100 );
58 in->read( (
char* ) &temp,
sizeof( qint32 ) );
134 QDataStream stream( &buffer, QIODevice::WriteOnly );
139 qint32 size = buffer.size();
140 out->write( (
const char* ) &size,
sizeof( qint32 ) );
141 out->write( buffer.data(), size );
147 while ( in->bytesAvailable() < ( int )
sizeof( qint32 ) ) {
148 if ( in->state() != QLocalSocket::ConnectedState )
150 in->waitForReadyRead( 100 );
153 in->read( (
char* ) &size,
sizeof( quint32 ) );
155 while ( in->bytesAvailable() < size ) {
156 if ( in->state() != QLocalSocket::ConnectedState )
158 in->waitForReadyRead( 100 );
161 QByteArray buffer= in->read( size );
162 QDataStream stream( buffer );
190 QDataStream stream( &buffer, QIODevice::WriteOnly );
191 stream << qint32(
type );
197 qint32 size = buffer.size();
198 out->write( (
const char* ) &size,
sizeof( qint32 ) );
199 out->write( buffer.data(), size );
205 while ( in->bytesAvailable() < ( int )
sizeof( qint32 ) ) {
206 if ( in->state() != QLocalSocket::ConnectedState )
208 in->waitForReadyRead( 100 );
211 in->read( (
char* ) &size,
sizeof( quint32 ) );
213 while ( in->bytesAvailable() < size ) {
214 if ( in->state() != QLocalSocket::ConnectedState )
216 in->waitForReadyRead( 100 );
219 QByteArray buffer= in->read( size );
220 QDataStream stream( buffer );
254 QDataStream stream( &buffer, QIODevice::WriteOnly );
257 qint32 size = buffer.size();
258 out->write( (
const char* ) &size,
sizeof( qint32 ) );
259 out->write( buffer.data(), size );
265 while ( in->bytesAvailable() < ( int )
sizeof( qint32 ) ) {
266 if ( in->state() != QLocalSocket::ConnectedState )
268 in->waitForReadyRead( 100 );
271 in->read( (
char* ) &size,
sizeof( quint32 ) );
273 while ( in->bytesAvailable() < size ) {
274 if ( in->state() != QLocalSocket::ConnectedState )
276 in->waitForReadyRead( 100 );
279 QByteArray buffer= in->read( size );
280 QDataStream stream( buffer );
299 out->write( (
const char* ) &temp,
sizeof( qint32 ) );
304 while ( in->bytesAvailable() < ( int )
sizeof( qint32 ) ) {
305 if ( in->state() != QLocalSocket::ConnectedState )
307 in->waitForReadyRead( 100 );
311 in->read( (
char* ) &temp,
sizeof( qint32 ) );
bool read(QLocalSocket *in)
void post(QIODevice *out)
bool read(QLocalSocket *in)
void post(QIODevice *out)
void post(QIODevice *out)
void post(QIODevice *out)
friend QDataStream & operator>>(QDataStream &in, Node &node)
bool read(QLocalSocket *in)
bool read(QLocalSocket *in)
enum MoNav::CommandType::Type value
enum MoNav::UnpackResult::ResultType type
bool read(QLocalSocket *in)
friend QDataStream & operator<<(QDataStream &out, const Node &node)
void post(QIODevice *out)
QVector< Edge > pathEdges
enum MoNav::RoutingResult::ResultType type
friend QDataStream & operator<<(QDataStream &out, const Edge &edge)
friend QDataStream & operator>>(QDataStream &in, Edge &edge)
QVector< Node > pathNodes
QVector< Node > waypoints