GCC Code Coverage Report


Directory: ./
File: Fw/Types/SerialBuffer.cpp
Date: 2026-09-03 21:13:48
Exec Total Coverage
Lines: 9 11 81.8%
Functions: 4 5 80.0%
Branches: 0 0 -%

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 1177 SerialBuffer ::SerialBuffer(U8* const data, const FwSizeType capacity) : LinearBufferBase(data, capacity) {}
19
20 FwSizeType SerialBuffer ::getBuffCapacity() const {
21 return this->getCapacity();
22 }
23
24 121 void SerialBuffer ::fill() {
25 121 const SerializeStatus status = this->setBuffLen(this->getCapacity());
26 121 FW_ASSERT(status == FW_SERIALIZE_OK);
27 121 }
28
29 130 SerializeStatus SerialBuffer ::pushBytes(const U8* const addr, const FwSizeType n) {
30 130 return this->serializeFrom(const_cast<U8*>(addr), n, Fw::Serialization::OMIT_LENGTH);
31 }
32
33 70193 SerializeStatus SerialBuffer ::popBytes(U8* const addr, FwSizeType n) {
34 70193 return this->deserializeTo(addr, n, Fw::Serialization::OMIT_LENGTH);
35 }
36
37 } // namespace Fw
38