SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
qrtplib
rtpendian.h
Go to the documentation of this file.
1
/*
2
* rtpendian.h
3
*
4
* Created on: Feb 27, 2018
5
* Author: f4exb
6
*/
7
8
#ifndef QRTPLIB_RTPENDIAN_H_
9
#define QRTPLIB_RTPENDIAN_H_
10
11
#include <QtEndian>
12
13
namespace
qrtplib
14
{
15
16
class
RTPEndian
17
{
18
public
:
19
RTPEndian
()
20
{
21
uint32_t
endianTest32 = 1;
22
uint8_t
*ptr = (
uint8_t
*) &endianTest32;
23
m_isLittleEndian
= (*ptr == 1);
24
}
25
26
template
<
typename
T>
27
T
qToHost
(
const
T& x)
const
28
{
29
return
m_isLittleEndian
? qToLittleEndian(x) : qToBigEndian(x);
30
}
31
32
private
:
33
bool
m_isLittleEndian
;
34
};
35
36
}
37
38
#endif
/* QRTPLIB_RTPENDIAN_H_ */
qrtplib::RTPEndian::qToHost
T qToHost(const T &x) const
Definition:
rtpendian.h:27
qrtplib::RTPEndian::m_isLittleEndian
bool m_isLittleEndian
Definition:
rtpendian.h:33
qrtplib::RTPEndian
Definition:
rtpendian.h:16
uint32_t
unsigned int uint32_t
Definition:
rtptypes_win.h:46
uint8_t
unsigned char uint8_t
Definition:
rtptypes_win.h:42
qrtplib::RTPEndian::RTPEndian
RTPEndian()
Definition:
rtpendian.h:19
qrtplib
Definition:
rtcpapppacket.cpp:35
Generated on Fri Aug 2 2019 17:56:32 for SDRAngel by
1.8.13