Proud::CMessage Class Reference
Inheritance diagram for Proud::CMessage:

Public Member Functions

bool IsSimplePacketMode () const
 
 CMessage (const CMessage &src)
 
bool DataEquals (const CMessage &rhs)
 
bool Read (uint8_t *data, int count)
 
template<typename POD >
bool Read_POD (POD *data)
 
bool CanRead (int count)
 
void Write (const uint8_t *data, int count)
 
template<typename POD >
void Write_POD (const POD *data)
 
void CopyFromArrayAndResetReadOffset (const uint8_t *src, int srcLength)
 
void SetReadOffset (int offset)
 
void SetSimplePacketMode (bool isSimplePacketMode)
 
void SetLength (int count)
 
int GetWriteOffset ()
 
bool Read_NoTestSplitter (uint8_t *data, int count)
 
template<typename POD >
bool Read_NoTestSplitter_POD (POD *data)
 
bool CanRead_NoTestSplitter (int count)
 
void Write_NoTestSplitter (const uint8_t *data, int count)
 
template<typename POD >
void Write_NoTestSplitter_POD (const POD *data)
 
void AdjustWriteOffsetByteAlign ()
 
bool ReadWithShareBuffer (CMessage &output, int length)
 
void Write (bool b)
 
void Write (int8_t b)
 
void Write (uint8_t b)
 
void Write (int16_t b)
 
void Write (uint16_t b)
 
void Write (int32_t b)
 
void Write (uint32_t b)
 
void Write (int64_t b)
 
void Write (uint64_t b)
 
void Write (float b)
 
void Write (double b)
 
void Write (HostID b)
 
void Write (const AddrPort &b)
 
bool Read (AddrPort &b)
 
bool Read (ByteArray &b)
 
void Write (const ByteArray &b)
 
void Write (ByteArrayPtr b)
 
bool Read (ByteArrayPtr &b)
 
bool ReadScalar (int64_t &a)
 
bool ReadScalar (int32_t &a)
 
bool ReadScalar (int16_t &a)
 
bool ReadScalar (int8_t &a)
 
bool ReadScalar (uint64_t &a)
 
bool ReadScalar (uint32_t &a)
 
bool ReadScalar (uint16_t &a)
 
bool ReadScalar (uint8_t &a)
 
void WriteScalar (int64_t a)
 
void WriteScalar (int32_t a)
 
void WriteScalar (int16_t a)
 
void WriteScalar (int8_t a)
 
void WriteScalar (uint64_t a)
 
void WriteScalar (uint32_t a)
 
void WriteScalar (uint16_t a)
 
void WriteScalar (uint8_t a)
 
bool Read (bool &b)
 
bool Read (int8_t &b)
 
bool Read (uint8_t &b)
 
bool Read (int16_t &b)
 
bool Read (uint16_t &b)
 
bool Read (int32_t &b)
 
bool Read (uint32_t &b)
 
bool Read (int64_t &b)
 
bool Read (uint64_t &b)
 
bool Read (float &b)
 
bool Read (double &b)
 
void Write (const Guid &b)
 
bool Read (Guid &b)
 
bool Read (HostID &b)
 
void Write (NamedAddrPort n)
 
bool Read (NamedAddrPort &n)
 
int GetLength () const
 
int GetReadOffset () const
 
void AppendByteArray (const uint8_t *fragment, int fragmentLength)
 
uint8_t * GetData ()
 
const uint8_t * GetData () const
 
template<typename BYTEARRAY >
void CopyToT (BYTEARRAY &dest)
 
void CopyTo (ByteArray &dest)
 
void CopyTo (ByteArrayPtr &dest)
 
void CopyTo (CMessage &dest)
 
void Clear ()
 
void ShareFromAndResetReadOffset (ByteArrayPtr data)
 
void UseExternalBuffer (uint8_t *buf, int capacity)
 
void UseInternalBuffer ()
 
void UninitBuffer ()
 
bool SkipRead (int count)
 읽은 것처럼 구라친다.
 
void WriteString (const char *str)
 
void WriteString (const wchar_t *str)
 
void WriteString (const Proud::StringA &str)
 
void WriteString (const Proud::StringW &str)
 
void WriteString (const std::string &str)
 
void WriteString (const std::wstring &str)
 
bool ReadString (Proud::StringA &str)
 
bool ReadString (Proud::StringW &str)
 
bool ReadString (std::string &str)
 
bool ReadString (std::wstring &str)
 
bool ReadStringA (Proud::StringA &str)
 
bool ReadStringW (Proud::StringW &str)
 
void WriteStringA (const char *str)
 
void WriteStringW (const wchar_t *str)
 
void WriteBits (uint8_t *src, int srcBitLength)
 
bool ReadBits (uint8_t *output, int outputBitLength)
 
bool ReadBits (bool &output, int outputBitLength)
 
void WriteBits (bool src, int srcBitLength)
 
bool ReadBits (int8_t &output, int outputBitLength)
 
void WriteBits (int8_t src, int srcBitLength)
 
bool ReadBits (uint8_t &output, int outputBitLength)
 
void WriteBits (uint8_t src, int srcBitLength)
 
bool ReadBits (int16_t &output, int outputBitLength)
 
void WriteBits (int16_t src, int srcBitLength)
 
bool ReadBits (uint16_t &output, int outputBitLength)
 
void WriteBits (uint16_t src, int srcBitLength)
 
bool ReadBits (int32_t &output, int outputBitLength)
 
void WriteBits (int32_t src, int srcBitLength)
 
bool ReadBits (uint32_t &output, int outputBitLength)
 
void WriteBits (uint32_t src, int srcBitLength)
 
bool ReadBits (float &output, int outputBitLength)
 
void WriteBits (float src, int srcBitLength)
 
bool ReadBits (double &output, int outputBitLength)
 
void WriteBits (double src, int srcBitLength)
 

Static Public Member Functions

template<typename T , bool RAWTYPE, typename COLLT >
static bool ReadArrayT (CMessage &a, COLLT &b)
 
template<typename T , bool RAWTYPE, typename COLLT >
static void WriteArrayT (CMessage &a, const COLLT &b)
 

Public Attributes

ByteArrayPtr m_msgBuffer
 

Friends

void AdjustReadOffsetByteAlign (CMessage &msg)
 
void AssureReadOffsetByteAlign (CMessage &msg)
 

Detailed Description

TODO:translate needed.

Member Function Documentation

int Proud::CMessage::GetLength ( ) const
inline

Gets the length of message

int Proud::CMessage::GetReadOffset ( ) const
inline

Calculates current read point of message. The return value is in byte.

bool Proud::CMessage::Read ( uint8_t *  data,
int  count 
)
inline

TODO:translate needed.

bool Proud::CMessage::Read ( bool &  b)
inline

Additionally writes data to message object Suuports various types including bool type

Returns
True if successful in thorough reading
bool Proud::CMessage::ReadBits ( uint8_t *  output,
int  outputBitLength 
)
inline

Reads bit data as much of bitCount

Returns
Returns true if reading is successful. Returns false when there are not enough bits to read.
  • If bit offset > 0 due to prior bit reading then reads continuous to usable remaining bits.
  • When reading byte unit due to Read() when bit offset > 0 then remaining bits will be ignored and the reading will be continued at a new byte. In other words, it will be modified to byte assign. Therefore, to use bits effectively, it must collectively read/write those fields, not fields and bits.
bool Proud::CMessage::ReadScalar ( int64_t &  a)
inline

Reads with scalar compression technique

bool Proud::CMessage::ReadString ( Proud::StringA str)
inline

Read string

bool Proud::CMessage::ReadString ( Proud::StringW str)
inline

Read string

bool Proud::CMessage::ReadString ( std::string &  str)
inline

Read string

bool Proud::CMessage::ReadString ( std::wstring &  str)
inline

Read string

bool Proud::CMessage::ReadWithShareBuffer ( CMessage output,
int  length 
)
inline

TODO:translate needed.

void Proud::CMessage::SetLength ( int  count)
inline

TODO:translate needed.

void Proud::CMessage::SetReadOffset ( int  offset)
inline

TODO:translate needed.

bool Proud::CMessage::SkipRead ( int  count)
inline

읽은 것처럼 구라친다.

TODO:translate needed.

void Proud::CMessage::UninitBuffer ( )
inline

Completely resets the PROUD_API void UseExternalBuffer(BYTE* buf, int capacity)r

  • This must be called in order to re-use UseExternalBuffer and UseInternalBuffer. The reasone why this kind of method exists is to prevent for user to make mistakes.
  • After this method is called, the size of read offset and message will be initialized.
void Proud::CMessage::UseExternalBuffer ( uint8_t *  buf,
int  capacity 
)
inline

TODO:translate needed. Declares to use external buffer

void Proud::CMessage::UseInternalBuffer ( )
inline

Declares to use internal buffer

void Proud::CMessage::Write ( const uint8_t *  data,
int  count 
)
inline

TODO:translate needed.

void Proud::CMessage::Write ( bool  b)
inline

TODO:translate needed.

void Proud::CMessage::WriteBits ( uint8_t *  src,
int  srcBitLength 
)
inline

Writes bit data as muuch of bitCount

  • If bit offset > 0 due to prior bit writing then writes continuous to usable remaining bits.
  • When writing byte unit due to Write() when bit offset > 0 then remaining bits will be ignored and the writing will be continued at a new byte. In other words, it will be modified to byte assign. Therefore, to use bits effectively, it must collectively read/write those fields, not fields and bits.
void Proud::CMessage::WriteScalar ( int64_t  a)
inline

Writes with scalar compression technique

void Proud::CMessage::WriteString ( const char *  str)
inline

Write string

void Proud::CMessage::WriteString ( const wchar_t *  str)
inline

Write string

void Proud::CMessage::WriteString ( const Proud::StringA str)
inline

Write string

void Proud::CMessage::WriteString ( const Proud::StringW str)
inline

Write string

void Proud::CMessage::WriteString ( const std::string &  str)
inline

Write string

void Proud::CMessage::WriteString ( const std::wstring &  str)
inline

Write string