F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HashBufferCommon.cpp
Go to the documentation of this file.
2#include <cstring>
3
4namespace Utils {
5
8
13
16
17 HashBuffer::HashBuffer(const HashBuffer& other) : Fw::SerializeBufferBase() {
19 FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
20 }
21
23 if(this == &other) {
24 return *this;
25 }
26
28 FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
29 return *this;
30 }
31
32 bool HashBuffer::operator==(const HashBuffer& other) const {
33 if( (this->getBuffLength() == other.getBuffLength()) &&
34 (memcmp(this->getBuffAddr(), other.getBuffAddr(), this->getBuffLength()) != 0) ){
35 return false;
36 }
37 return true;
38 }
39
40 bool HashBuffer::operator!=(const HashBuffer& other) const {
41 return !(*this == other);
42 }
43
44 const U8* HashBuffer::getBuffAddr() const {
45 return this->m_bufferData;
46 }
47
49 return this->m_bufferData;
50 }
51
53 return sizeof(this->m_bufferData);
54 }
55}
#define FW_ASSERT(...)
Definition Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
uint8_t U8
8-bit unsigned integer
Definition BasicTypes.h:26
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
SerializeStatus setBuff(const U8 *src, NATIVE_UINT_TYPE length)
sets buffer contents and size
NATIVE_UINT_TYPE getBuffLength() const
returns current buffer size
A container class for holding a hash buffer.
HashBuffer & operator=(const HashBuffer &other)
NATIVE_UINT_TYPE getBuffCapacity() const
bool operator==(const HashBuffer &other) const
bool operator!=(const HashBuffer &other) const
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.