F´ Flight Software - C/C++ Documentation  NASA-v2.0.1
A framework for building embedded system applications to NASA flight quality standards.
HashBufferCommon.cpp
Go to the documentation of this file.
2 #include <string.h>
3 
4 namespace Utils {
5 
7  }
8 
11  FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
12  }
13 
15  }
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 
24  FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
25  return *this;
26  }
27 
28  bool HashBuffer::operator==(const HashBuffer& other) const {
29  if( (this->getBuffLength() == other.getBuffLength()) &&
30  (memcmp(this->getBuffAddr(), other.getBuffAddr(), this->getBuffLength()) != 0) ){
31  return false;
32  }
33  return true;
34  }
35 
36  bool HashBuffer::operator!=(const HashBuffer& other) const {
37  return !(*this == other);
38  }
39 
40  const U8* HashBuffer::getBuffAddr(void) const {
41  return this->m_data;
42  }
43 
45  return this->m_data;
46  }
47 
49  return sizeof(this->m_data);
50  }
51 }
Utils::HashBuffer::~HashBuffer
virtual ~HashBuffer()
Definition: HashBufferCommon.cpp:14
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition: Serializable.hpp:14
Utils::HashBuffer::getBuffCapacity
NATIVE_UINT_TYPE getBuffCapacity(void) const
Definition: HashBufferCommon.cpp:48
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Utils::HashBuffer::operator=
const HashBuffer & operator=(const HashBuffer &other)
Definition: HashBufferCommon.cpp:22
Utils
Definition: CRCChecker.cpp:20
Utils::HashBuffer
An container class for holding a hash buffer.
Definition: HashBuffer.hpp:26
Fw::FW_SERIALIZE_OK
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Definition: Serializable.hpp:15
Utils::HashBuffer::getBuffAddr
U8 * getBuffAddr(void)
Definition: HashBufferCommon.cpp:44
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Utils::HashBuffer::operator!=
bool operator!=(const HashBuffer &other) const
Definition: HashBufferCommon.cpp:36
Utils::HashBuffer::operator==
bool operator==(const HashBuffer &other) const
Definition: HashBufferCommon.cpp:28
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
Fw::SerializeBufferBase::getBuffLength
NATIVE_UINT_TYPE getBuffLength() const
returns current buffer size
Definition: Serializable.cpp:587
Fw::SerializeBufferBase::setBuff
SerializeStatus setBuff(const U8 *src, NATIVE_UINT_TYPE length)
sets buffer contents and size
Definition: Serializable.cpp:591
Utils::HashBuffer::HashBuffer
HashBuffer()
Definition: HashBufferCommon.cpp:6
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
HashBuffer.hpp
Fw
Definition: Buffer.cpp:21