OTB  6.7.0
Orfeo Toolbox
Namespaces | Macros | Functions
mvdDataStream.h File Reference
#include "ConfigureMonteverdi.h"
#include "OTBMonteverdiCoreExport.h"
#include <QtCore>
#include <typeinfo>
#include "mvdAlgorithm.h"
#include "mvdSystemError.h"
+ Include dependency graph for mvdDataStream.h:

Go to the source code of this file.

Namespaces

 mvd
 

Macros

#define DATA_STREAM_USE_TEMPLATE_OPERATORS   1
 
#define DATA_STREAM_OUT(ostream, T, pointer)
 
#define DATA_STREAM_IN(istream, T, pointer)
 

Functions

QDataStream & operator<< (QDataStream &out, void const *&pointer)
 
QDataStream & operator>> (QDataStream &in, void *&pointer)
 
template<typename T >
QDataStream & operator<< (QDataStream &out, T const *&pointer)
 
template<typename T >
QDataStream & operator>> (QDataStream &in, T *&pointer)
 

Macro Definition Documentation

#define DATA_STREAM_IN (   istream,
  T,
  pointer 
)
Value:
{ \
size_t size = sizeof( T * ); \
\
int count = \
istream.readRawData( \
reinterpret_cast< char * >( &pointer ), size ); \
\
if( false ) \
qDebug() \
<< "Read" << count << "byte(s) as" << typeid( T ).name() \
<< "address" << pointer << "size" << size; \
\
if( static_cast< size_t >( count )!=size ) \
throw \
mvd::SystemError( \
QString( "Error when reading %1 pointer from QDataStream." ) \
.arg( typeid( T ).name() ) \
) \
); \
}
std::string ToStdString(const QString &str)
Convert and copy a QString to a STL std::string.
Definition: mvdAlgorithm.h:513

Definition at line 98 of file mvdDataStream.h.

Referenced by operator>>().

#define DATA_STREAM_OUT (   ostream,
  T,
  pointer 
)
Value:
{ \
size_t size = sizeof( T const * ); \
\
int count = \
ostream.writeRawData( \
reinterpret_cast< char const * >( &pointer ), \
size \
); \
\
if( false ) \
qDebug() \
<< "Written" << count << "byte(s) as" << typeid( T ).name() \
<< "address" << pointer << "size" << size; \
\
if( static_cast< size_t >( count )!=size ) \
throw \
mvd::SystemError( \
QString( "Error when writing %1 pointer to QDataStream." ) \
.arg( typeid( T ).name() ) \
) \
); \
}
std::string ToStdString(const QString &str)
Convert and copy a QString to a STL std::string.
Definition: mvdAlgorithm.h:513

Definition at line 70 of file mvdDataStream.h.

Referenced by operator<<().

#define DATA_STREAM_USE_TEMPLATE_OPERATORS   1

Definition at line 138 of file mvdDataStream.h.

Function Documentation

QDataStream& operator<< ( QDataStream &  out,
void const *&  pointer 
)
template<typename T >
QDataStream & operator<< ( QDataStream &  out,
T const *&  pointer 
)
inline

Definition at line 173 of file mvdDataStream.h.

References DATA_STREAM_OUT.

QDataStream& operator>> ( QDataStream &  in,
void *&  pointer 
)
template<typename T >
QDataStream & operator>> ( QDataStream &  in,
T *&  pointer 
)
inline

Definition at line 192 of file mvdDataStream.h.

References DATA_STREAM_IN.