| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // ====================================================================== | ||
| 2 | // \title SerialBuffer.cpp | ||
| 3 | // \author bocchino | ||
| 4 | // \brief cpp file for SerialBuffer type | ||
| 5 | // | ||
| 6 | // \copyright | ||
| 7 | // Copyright (C) 2016 California Institute of Technology. | ||
| 8 | // ALL RIGHTS RESERVED. United States Government Sponsorship | ||
| 9 | // acknowledged. | ||
| 10 | // | ||
| 11 | // ====================================================================== | ||
| 12 | |||
| 13 | #include "Fw/Types/SerialBuffer.hpp" | ||
| 14 | #include "Fw/Types/Assert.hpp" | ||
| 15 | |||
| 16 | namespace Fw { | ||
| 17 | |||
| 18 | 6 | SerialBuffer ::SerialBuffer(U8* const data, const FwSizeType capacity) : LinearBufferBase(data, capacity) {} | |
| 19 | |||
| 20 | ✗ | FwSizeType SerialBuffer ::getBuffCapacity() const { | |
| 21 | ✗ | return this->getCapacity(); | |
| 22 | } | ||
| 23 | |||
| 24 | 6 | void SerialBuffer ::fill() { | |
| 25 | 6 | const SerializeStatus status = this->setBuffLen(this->getCapacity()); | |
| 26 | 6 | FW_ASSERT(status == FW_SERIALIZE_OK); | |
| 27 | 6 | } | |
| 28 | |||
| 29 | ✗ | SerializeStatus SerialBuffer ::pushBytes(const U8* const addr, const FwSizeType n) { | |
| 30 | ✗ | return this->serializeFrom(const_cast<U8*>(addr), n, Fw::Serialization::OMIT_LENGTH); | |
| 31 | } | ||
| 32 | |||
| 33 | 4 | SerializeStatus SerialBuffer ::popBytes(U8* const addr, FwSizeType n) { | |
| 34 | 4 | return this->deserializeTo(addr, n, Fw::Serialization::OMIT_LENGTH); | |
| 35 | } | ||
| 36 | |||
| 37 | } // namespace Fw | ||
| 38 |