fprime/Os/Stub/test/RawTime.cpp
Vince Woo 48e4720419
Created new SerialBufferBase as a parent of SerializeBufferBase (now renamed LinearBufferBase). (#4288)
* Created new SerialBufferBase as a parent of SerializeBufferBase. Renaming interface functions to be less confusing.

* Deprecating copyRawOffset. No direct use-cases in F' core.

* Make SerialBufferBase a true pure virtual interface.

* Changing Serializable to work with SerialBufferBase parent interface.

* Changing copyRaw and copyRawOffset to work with SerialBufferBase

* Updating documentation for SerialBufferBase usage

* Adding some documentation. Adding missing ASSERT in copyRaw. Fixing some bugs that new ASSERT uncovered.

* Renaming SerializeBufferBase to LinearBufferBase. Add a using declaration to maintain backwards compatability. Properly mark LinearBufferBase functions as override.

* Filling in the rest of the docstrings for the classes in Serializable

* Removing redundant virtual keyword on override function

* Applying clang formatting

* Incorporating PR comments

* Fix compile issues

* Bump version to alpha

* Format

* v

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-11-06 16:23:20 -08:00

55 lines
1.6 KiB
C++

// ======================================================================
// \title Os/Stub/RawTime.cpp
// \brief stub implementation for Os::RawTime
// ======================================================================
#include "Os/Stub/test/RawTime.hpp"
namespace Os {
namespace Stub {
namespace RawTime {
namespace Test {
StaticData StaticData::data;
TestRawTime::TestRawTime() {
StaticData::data.lastCalled = StaticData::LastFn::CONSTRUCT_FN;
}
TestRawTime::TestRawTime(const TestRawTime& other) {
StaticData::data.lastCalled = StaticData::LastFn::COPY_CONSTRUCT_FN;
}
TestRawTime::~TestRawTime() {
StaticData::data.lastCalled = StaticData::LastFn::DESTRUCT_FN;
}
RawTimeHandle* TestRawTime::getHandle() {
StaticData::data.lastCalled = StaticData::LastFn::GET_HANDLE_FN;
return &this->m_handle;
}
TestRawTime::Status TestRawTime::now() {
StaticData::data.lastCalled = StaticData::LastFn::GET_TIME_FN;
return Status::OP_OK;
}
TestRawTime::Status TestRawTime::getTimeInterval(const Os::RawTime& other, Fw::TimeInterval& interval) const {
StaticData::data.lastCalled = StaticData::LastFn::GET_INTERVAL_FN;
return Status::OP_OK;
}
Fw::SerializeStatus TestRawTime::serializeTo(Fw::SerialBufferBase& buffer, Fw::Endianness mode) const {
StaticData::data.lastCalled = StaticData::LastFn::SERIALIZE_FN;
return Fw::FW_SERIALIZE_OK;
}
Fw::SerializeStatus TestRawTime::deserializeFrom(Fw::SerialBufferBase& buffer, Fw::Endianness mode) {
StaticData::data.lastCalled = StaticData::LastFn::DESERIALIZE_FN;
return Fw::FW_SERIALIZE_OK;
}
} // namespace Test
} // namespace RawTime
} // namespace Stub
} // namespace Os