repo_name
stringclasses
10 values
file_path
stringlengths
29
222
content
stringlengths
24
926k
extention
stringclasses
5 values
fprime
data/projects/fprime/Fw/Types/PolyType.cpp
#include <Fw/Types/PolyType.hpp> #include <Fw/Types/Assert.hpp> #include <cstdio> #define __STDC_FORMAT_MACROS namespace Fw { // U8 methods PolyType::PolyType() { this->m_dataType = TYPE_NOTYPE; } PolyType::PolyType(U8 val) { this->m_dataType = TYPE_U8; this->m_val.u8Val = va...
cpp
fprime
data/projects/fprime/Fw/Types/SerialBuffer.hpp
// ====================================================================== // \title SerialBuffer.hpp // \author bocchino // \brief hpp file for SerialBuffer type // // \copyright // Copyright (C) 2016 California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledged. //...
hpp
fprime
data/projects/fprime/Fw/Types/Serializable.cpp
#include <Fw/Types/Serializable.hpp> #include <cstring> // memcpy #include <Fw/Types/Assert.hpp> #include <Fw/Types/StringType.hpp> #include <cstdio> #include <FpConfig.hpp> #ifdef BUILD_UT #include <iomanip> #include <Fw/Types/String.hpp> #endif // Some macros/functions to optimize for architectures namespace Fw { ...
cpp
fprime
data/projects/fprime/Fw/Types/PolyType.hpp
#ifndef FW_POLY_TYPE_HPP #define FW_POLY_TYPE_HPP #include <FpConfig.hpp> #include <Fw/Types/StringType.hpp> #include <Fw/Types/Serializable.hpp> #include <Fw/Cfg/SerIds.hpp> namespace Fw { class PolyType : public Serializable { public: PolyType(U8 val); //!< U8 constructor opera...
hpp
fprime
data/projects/fprime/Fw/Types/StringUtils.cpp
#include "StringUtils.hpp" #include <Fw/Types/Assert.hpp> #include <cstring> char* Fw::StringUtils::string_copy(char* destination, const char* source, U32 num) { // Handle self-copy and 0 bytes copy if(destination == source || num == 0) { return destination; } FW_ASSERT(source != nullptr); ...
cpp
fprime
data/projects/fprime/Fw/Types/MemAllocator.hpp
/** * \file * \author T. Canham * \brief Defines a base class for a memory allocator for classes. * * A memory allocator is a class that provides memory for a component. * This allows a user of the class to allocate memory as they choose. * The user writes derived classes for each of the allocator types. * * \...
hpp
fprime
data/projects/fprime/Fw/Types/ByteArray.hpp
// ====================================================================== // \title ByteArray.hpp // \author bocchino // \brief hpp file for ByteArray type // // \copyright // Copyright (C) 2016 California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledged. // // ...
hpp
fprime
data/projects/fprime/Fw/Types/default/DefaultTypes.hpp
/** * \brief DefaultTypes.hpp provides fallback defaults for the platform types * * This fill contains default implementations for types typically defined in * PlatformTypes.hpp. These default implementations are based on x86_64 Linux * but are often appropriate for most systems. */ #include <limits> /** * Defaul...
hpp
fprime
data/projects/fprime/Fw/Types/GTest/Bytes.hpp
// ====================================================================== // \title Fw/Types/GTest/Bytes.hpp // \author bocchino // \brief hpp file for Bytes // // \copyright // Copyright (C) 2016 California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledged. // /...
hpp
fprime
data/projects/fprime/Fw/Types/GTest/Bytes.cpp
// ====================================================================== // \title ASTERIA/Types/GTest/Bytes.cpp // \author bocchino // \brief cpp file for Bytes // // \copyright // Copyright (C) 2016, California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledged....
cpp
fprime
data/projects/fprime/Fw/Types/test/ut/TypesTest.cpp
#include <FpConfig.hpp> #include <Fw/Types/Serializable.hpp> #include <Os/IntervalTimer.hpp> #include <Os/InterruptLock.hpp> #include <Fw/Types/Assert.hpp> #include <Fw/Types/String.hpp> #include <Fw/Types/InternalInterfaceString.hpp> #include <Fw/Types/ObjectName.hpp> #include <Fw/Types/PolyType.hpp> #include <Fw/Type...
cpp
fprime
data/projects/fprime/Fw/Time/Time.cpp
#include <Fw/Time/Time.hpp> #include <FpConfig.hpp> namespace Fw { const Time ZERO_TIME = Time(); Time::Time() : m_seconds(0), m_useconds(0), m_timeBase(TB_NONE), m_timeContext(0) { } Time::~Time() { } Time::Time(const Time& other) : Serializable() { this->set(other.m_timeBase,other...
cpp
fprime
data/projects/fprime/Fw/Time/Time.hpp
#ifndef FW_TIME_HPP #define FW_TIME_HPP #include <FpConfig.hpp> #include <Fw/Types/Assert.hpp> #include <Fw/Types/Serializable.hpp> namespace Fw { class Time: public Serializable { public: enum { SERIALIZED_SIZE = sizeof(FwTimeBaseStoreType) + sizeof(FwTime...
hpp
fprime
data/projects/fprime/Fw/Time/test/ut/TimeTest.cpp
/* * TimeTest.cpp * * Created on: Apr 22, 2016 * Author: tcanham */ #include <Fw/Time/Time.hpp> #include <iostream> #include <gtest/gtest.h> TEST(TimeTestNominal,InstantiateTest) { Fw::Time time(TB_NONE,1,2); ASSERT_EQ(time.m_timeBase,TB_NONE); ASSERT_EQ(time.m_timeContext,0); ASSERT_EQ(ti...
cpp
fprime
data/projects/fprime/Fw/Port/InputPortBase.cpp
#include <FpConfig.hpp> #include <Fw/Port/InputPortBase.hpp> #include <Fw/Types/Assert.hpp> #include <cstdio> namespace Fw { InputPortBase::InputPortBase() : PortBase(), m_comp(nullptr), m_portNum(-1) { } InputPortBase::~InputPortBase() { }...
cpp
fprime
data/projects/fprime/Fw/Port/PortBase.hpp
#ifndef FW_PORT_BASE_HPP #define FW_PORT_BASE_HPP #include <Fw/Obj/ObjBase.hpp> #include <FpConfig.hpp> #include <Fw/Types/Serializable.hpp> #if FW_PORT_TRACING == 1 extern "C" { void setConnTrace(bool trace); } #endif namespace Fw { class PortBase : public Fw::ObjBase { public: #if FW_PORT_TRACING ...
hpp
fprime
data/projects/fprime/Fw/Port/InputSerializePort.cpp
#include <Fw/Port/InputSerializePort.hpp> #include <Fw/Types/Assert.hpp> #include <cstdio> #if FW_PORT_SERIALIZATION == 1 namespace Fw { // SerializePort has no call interface. It is to pass through serialized data InputSerializePort::InputSerializePort() : InputPortBase(), m_func(nullptr) { } InputS...
cpp
fprime
data/projects/fprime/Fw/Port/PortBase.cpp
#include <Fw/Port/PortBase.hpp> #include <FpConfig.hpp> #include <Fw/Logger/Logger.hpp> #include <cstdio> #include "Fw/Types/Assert.hpp" #if FW_PORT_TRACING void setConnTrace(bool trace) { Fw::PortBase::setTrace(trace); } namespace Fw { bool PortBase::s_trace = false; } #endif // FW_PORT_TRACING namespace F...
cpp
fprime
data/projects/fprime/Fw/Port/OutputPortBase.cpp
#include <FpConfig.hpp> #include <Fw/Port/OutputPortBase.hpp> #include <Os/Log.hpp> #include <cstdio> #include <Fw/Types/Assert.hpp> namespace Fw { OutputPortBase::OutputPortBase() : PortBase() #if FW_PORT_SERIALIZATION == 1 ,m_serPort(nullptr) #endif { } OutputPortBase::~OutputPortBase() {...
cpp
fprime
data/projects/fprime/Fw/Port/OutputPortBase.hpp
#ifndef FW_OUTPUT_PORT_BASE_HPP #define FW_OUTPUT_PORT_BASE_HPP #include <FpConfig.hpp> #include <Fw/Obj/ObjBase.hpp> #include <Fw/Types/Serializable.hpp> #include <Fw/Port/InputPortBase.hpp> namespace Fw { class OutputPortBase : public PortBase { public: #if FW_PORT_SERIALIZATION == 1 void r...
hpp
fprime
data/projects/fprime/Fw/Port/OutputSerializePort.cpp
#include <Fw/Port/OutputSerializePort.hpp> #include <Fw/Types/Assert.hpp> #include <cstdio> #if FW_PORT_SERIALIZATION namespace Fw { // SerializePort has no call interface. It is to pass through serialized data OutputSerializePort::OutputSerializePort() : OutputPortBase() { } OutputSerializePort::~...
cpp
fprime
data/projects/fprime/Fw/Port/InputPortBase.hpp
#ifndef FW_INPUT_PORT_BASE_HPP #define FW_INPUT_PORT_BASE_HPP #include <FpConfig.hpp> #include <Fw/Obj/ObjBase.hpp> #include <Fw/Types/Serializable.hpp> #include <Fw/Comp/PassiveComponentBase.hpp> #include <Fw/Port/PortBase.hpp> namespace Fw { class InputPortBase : public PortBase { public: v...
hpp
fprime
data/projects/fprime/Fw/Port/InputSerializePort.hpp
#ifndef FW_INPUT_SERIALIZE_PORT_HPP #define FW_INPUT_SERIALIZE_PORT_HPP #include <FpConfig.hpp> #if FW_PORT_SERIALIZATION == 1 #include <Fw/Port/InputPortBase.hpp> namespace Fw { class InputSerializePort : public InputPortBase { public: InputSerializePort(); virtual ~InputSerial...
hpp
fprime
data/projects/fprime/Fw/Port/OutputSerializePort.hpp
#ifndef FW_OUTPUT_SERIALIZE_PORT_HPP #define FW_OUTPUT_SERIALIZE_PORT_HPP #include <FpConfig.hpp> #if FW_PORT_SERIALIZATION == 1 #include <Fw/Port/OutputPortBase.hpp> namespace Fw { class OutputSerializePort : public OutputPortBase { public: OutputSerializePort(); virtual ~Outpu...
hpp
fprime
data/projects/fprime/Fw/Log/TextLogString.hpp
#ifndef FW_TEXT_LOG_STRING_TYPE_HPP #define FW_TEXT_LOG_STRING_TYPE_HPP #include <FpConfig.hpp> #include <Fw/Types/StringType.hpp> #include <Fw/Cfg/SerIds.hpp> namespace Fw { class TextLogString : public Fw::StringBase { public: enum { SERIALIZED_TYPE_ID = FW_TYPEID_LOG_STR, ...
hpp
fprime
data/projects/fprime/Fw/Log/LogPacket.hpp
/* * LogPacket.hpp * * Created on: May 24, 2014 * Author: Timothy Canham */ #ifndef LOGPACKET_HPP_ #define LOGPACKET_HPP_ #include <Fw/Com/ComPacket.hpp> #include <Fw/Log/LogBuffer.hpp> #include <Fw/Time/Time.hpp> namespace Fw { class LogPacket : public ComPacket { public: LogPac...
hpp
fprime
data/projects/fprime/Fw/Log/TextLogString.cpp
#include <Fw/Log/TextLogString.hpp> #include <Fw/Types/StringUtils.hpp> namespace Fw { TextLogString::TextLogString(const char* src) : StringBase() { (void) Fw::StringUtils::string_copy(this->m_buf, src, sizeof(this->m_buf)); } TextLogString::TextLogString(const StringBase& src): StringBase() { ...
cpp
fprime
data/projects/fprime/Fw/Log/LogString.hpp
#ifndef FW_LOG_STRING_TYPE_HPP #define FW_LOG_STRING_TYPE_HPP #include <FpConfig.hpp> #include <Fw/Types/StringType.hpp> #include <Fw/Cfg/SerIds.hpp> namespace Fw { class LogStringArg : public Fw::StringBase { public: enum { SERIALIZED_TYPE_ID = FW_TYPEID_LOG_STR, ...
hpp
fprime
data/projects/fprime/Fw/Log/AmpcsEvrLogPacket.cpp
/* * AmpcsEvrLogPacket.cpp * * Created on: October 07, 2016 * Author: Kevin F. Ortega * Aadil Rizvi */ #include <Fw/Log/AmpcsEvrLogPacket.hpp> #include <Fw/Types/Assert.hpp> namespace Fw { AmpcsEvrLogPacket::AmpcsEvrLogPacket() : m_eventID(0), m_overSeqNum(0), m_catSeqN...
cpp
fprime
data/projects/fprime/Fw/Log/LogBuffer.hpp
/* * LogBuffer.hpp * * Created on: Sep 10, 2012 * Author: ppandian */ /* * Description: * This object contains the LogBuffer type, used for storing log entries */ #ifndef FW_LOG_BUFFER_HPP #define FW_LOG_BUFFER_HPP #include <FpConfig.hpp> #include <Fw/Types/Serializable.hpp> #include <Fw/Cfg/SerIds.hpp>...
hpp
fprime
data/projects/fprime/Fw/Log/LogString.cpp
#include <Fw/Log/LogString.hpp> #include <Fw/Types/StringUtils.hpp> namespace Fw { LogStringArg::LogStringArg(const char* src) : StringBase() { (void) Fw::StringUtils::string_copy(this->m_buf, src, sizeof(this->m_buf)); } LogStringArg::LogStringArg(const StringBase& src) : StringBase() { ...
cpp
fprime
data/projects/fprime/Fw/Log/LogPacket.cpp
/* * LogPacket.cpp * * Created on: May 24, 2014 * Author: Timothy Canham */ #include <Fw/Log/LogPacket.hpp> #include <Fw/Types/Assert.hpp> namespace Fw { LogPacket::LogPacket() : m_id(0) { this->m_type = FW_PACKET_LOG; } LogPacket::~LogPacket() { } SerializeStatus LogPacket::...
cpp
fprime
data/projects/fprime/Fw/Log/LogBuffer.cpp
#include <Fw/Log/LogBuffer.hpp> #include <Fw/Types/Assert.hpp> namespace Fw { LogBuffer::LogBuffer(const U8 *args, NATIVE_UINT_TYPE size) { SerializeStatus stat = SerializeBufferBase::setBuff(args,size); FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_UINT_TYPE>(stat)); } LogBuffer::...
cpp
fprime
data/projects/fprime/Fw/Log/AmpcsEvrLogPacket.hpp
/* * AmpcsEvrLogPacket.hpp * * Created on: October 07, 2016 * Author: Kevin F. Ortega * Aadil Rizvi */ #ifndef AMPCS_EVR_LOGPACKET_HPP_ #define AMPCS_EVR_LOGPACKET_HPP_ #include <Fw/Com/ComPacket.hpp> #include <Fw/Log/LogBuffer.hpp> #include <Fw/Time/Time.hpp> #include <cstring> #define AMPC...
hpp
fprime
data/projects/fprime/Fw/Log/test/ut/LogTest.cpp
#include <gtest/gtest.h> #include <Fw/Log/LogPacket.hpp> #include <Fw/Com/ComBuffer.hpp> #include <Fw/Log/LogString.hpp> TEST(FwLogTest,LogPacketSerialize) { // Serialize data Fw::LogPacket pktIn; Fw::LogBuffer buffIn; ASSERT_EQ(Fw::FW_SERIALIZE_OK,buffIn.serialize(static_cast<U32>(12))); Fw::Tim...
cpp
fprime
data/projects/fprime/Fw/Comp/ActiveComponentBase.hpp
/* * ActiveComponentBase.hpp * * Created on: Aug 14, 2012 * Author: tcanham */ /* * Description: */ #ifndef FW_ACTIVE_COMPONENT_BASE_HPP #define FW_ACTIVE_COMPONENT_BASE_HPP #include <FpConfig.hpp> #include <Fw/Comp/QueuedComponentBase.hpp> #include <Fw/Deprecate.hpp> #include <Os/Task.hpp> namespace Fw...
hpp
fprime
data/projects/fprime/Fw/Comp/QueuedComponentBase.hpp
/* * ActiveComponentBase.hpp * * Created on: Aug 14, 2012 * Author: tcanham */ /* * Description: */ #ifndef FW_QUEUED_COMPONENT_BASE_HPP #define FW_QUEUED_COMPONENT_BASE_HPP #include <Fw/Comp/PassiveComponentBase.hpp> #include <Os/Queue.hpp> #include <Os/Task.hpp> #include <FpConfig.hpp> namespace Fw {...
hpp
fprime
data/projects/fprime/Fw/Comp/PassiveComponentBase.cpp
#include <Fw/Comp/PassiveComponentBase.hpp> #include <Fw/Types/Assert.hpp> #include <FpConfig.hpp> #include <cstdio> namespace Fw { PassiveComponentBase::PassiveComponentBase(const char* name) : Fw::ObjBase(name), m_idBase(0), m_instance(0) { } #if FW_OBJECT_TO_STRING == 1 && FW_OBJECT_NAMES == 1 void P...
cpp
fprime
data/projects/fprime/Fw/Comp/PassiveComponentBase.hpp
#ifndef FW_COMP_BASE_HPP #define FW_COMP_BASE_HPP #include <Fw/Obj/ObjBase.hpp> #include <Fw/Types/Serializable.hpp> #include <FpConfig.hpp> namespace Fw { class PassiveComponentBase : public Fw::ObjBase { public: //! Set the ID base void setIdBase( const U32 //< T...
hpp
fprime
data/projects/fprime/Fw/Comp/ActiveComponentBase.cpp
#include <FpConfig.hpp> #include <Fw/Comp/ActiveComponentBase.hpp> #include <Fw/Types/Assert.hpp> #include <Os/TaskString.hpp> #include <cstdio> //#define DEBUG_PRINT(...) printf(##__VA_ARGS__); fflush(stdout) #define DEBUG_PRINT(...) namespace Fw { class ActiveComponentExitSerializableBuffer : public Fw::Serial...
cpp
fprime
data/projects/fprime/Fw/Comp/QueuedComponentBase.cpp
#include <Fw/Comp/QueuedComponentBase.hpp> #include <Fw/Types/Assert.hpp> #include <FpConfig.hpp> #include <Os/QueueString.hpp> #include <cstdio> namespace Fw { QueuedComponentBase::QueuedComponentBase(const char* name) : PassiveComponentBase(name),m_msgsDropped(0) { } QueuedComponentBase::~QueuedCompo...
cpp
fprime
data/projects/fprime/Fw/Buffer/Buffer.cpp
// ====================================================================== // \title Buffer.cpp // \author mstarch // \brief cpp file for Fw::Buffer implementation // // \copyright // Copyright 2009-2020, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknow...
cpp
fprime
data/projects/fprime/Fw/Buffer/Buffer.hpp
// ====================================================================== // \title Buffer.hpp // \author mstarch // \brief hpp file for Fw::Buffer definition // // \copyright // Copyright 2009-2020, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledg...
hpp
fprime
data/projects/fprime/Fw/Buffer/test/ut/TestBuffer.cpp
// // Created by mstarch on 11/13/20. // #include "Fw/Buffer/Buffer.hpp" #include <FpConfig.hpp> #include <gtest/gtest.h> void test_basic() { U8 data[100]; U8 faux[100]; Fw::Buffer buffer; // Check basic guarantees ASSERT_EQ(buffer.m_context, Fw::Buffer::NO_CONTEXT); buffer.setData(data); ...
cpp
fprime
data/projects/fprime/Os/Mem.hpp
#ifndef _Mem_hpp_ #define _Mem_hpp_ #include <FpConfig.hpp> #include <Fw/Obj/ObjBase.hpp> #include <Fw/Types/Serializable.hpp> namespace Os { class Mem { public: static U32 virtToPhys(U32 virtAddr); //!< Translate virtual to physical memory static U32 physToVirt(U32 physAddr); //!<...
hpp
fprime
data/projects/fprime/Os/SimpleQueueRegistry.cpp
/* * SimpleQueueRegistry.cpp * * Created on: Apr 7, 2016 * Author: tcanham */ #if FW_QUEUE_REGISTRATION #include <Os/SimpleQueueRegistry.hpp> namespace Os { SimpleQueueRegistry::SimpleQueueRegistry() { } SimpleQueueRegistry::~SimpleQueueRegistry() { } void SimpleQueueRegistry::regQu...
cpp
fprime
data/projects/fprime/Os/InterruptLock.hpp
#ifndef _InterruptLock_hpp_ #define _InterruptLock_hpp_ #include <FpConfig.hpp> namespace Os { class InterruptLock { public: InterruptLock(); //!< Constructor virtual ~InterruptLock(); //!< destructor void lock(); //!< lock interrupts void unLock(); //!< u...
hpp
fprime
data/projects/fprime/Os/File.cpp
// ====================================================================== // \title Os/File.cpp // \brief common function implementation for Os::File // ====================================================================== #include <Os/File.hpp> #include <Fw/Types/Assert.hpp> extern "C" { #include <Utils/Hash/libcrc/...
cpp
fprime
data/projects/fprime/Os/SimpleQueueRegistry.hpp
/** * \file * \author T. Canham * \brief Class declaration for a simple queue registry * * The simple object registry is meant to give a default implementation * and an example of a queue registry. When the registry is instantiated, * it registers itself with the setQueueRegistry() static method. When * queues ...
hpp
fprime
data/projects/fprime/Os/ValidatedFile.hpp
// ====================================================================== // \title ValidatedFile.hpp // \author bocchino // \brief An fprime validated file // // \copyright // Copyright (C) 2017 California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledged. // // =...
hpp
fprime
data/projects/fprime/Os/IPCQueueCommon.cpp
#include <Os/IPCQueue.hpp> #include <cstring> namespace Os { Queue::QueueStatus IPCQueue::send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block) { const U8* msgBuff = buffer.getBuffAddr(); NATIVE_INT_TYPE buffLength = buffer.getBuffLength(); return thi...
cpp
fprime
data/projects/fprime/Os/ValidatedFile.cpp
// ====================================================================== // \title ValidatedFile.cpp // \author bocchino // \brief Os::ValidatedFile implementation // // \copyright // Copyright (C) 2017 California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // acknowledged....
cpp
fprime
data/projects/fprime/Os/Directory.hpp
#ifndef _Directory_hpp_ #define _Directory_hpp_ #include <FpConfig.hpp> namespace Os { // This class encapsulates a very simple directory interface that has the most often-used features class Directory { public: typedef enum { OP_OK, //!< Operation was successful ...
hpp
fprime
data/projects/fprime/Os/TaskCommon.cpp
#include <Os/Task.hpp> #include <Fw/Types/Assert.hpp> #include <FpConfig.hpp> namespace Os { const Task::ParamType Task::TASK_DEFAULT = std::numeric_limits<Task::ParamType>::max(); TaskRegistry* Task::s_taskRegistry = nullptr; NATIVE_INT_TYPE Task::s_numTasks = 0; NATIVE_INT_TYPE Task::getNumTas...
cpp
fprime
data/projects/fprime/Os/Task.hpp
#ifndef _Task_hpp_ #define _Task_hpp_ #include <FpConfig.hpp> #include <Fw/Types/Serializable.hpp> #include <Os/TaskString.hpp> #include <Fw/Deprecate.hpp> #include <Os/TaskId.hpp> #include <limits> namespace Os { class TaskRegistry; //!< forward declaration class Task { public: using ParamType = NATIVE_UINT...
hpp
fprime
data/projects/fprime/Os/TaskLock.hpp
// File: TaskLock.hpp // Author: Nathan Serafin (nathan.serafin@jpl.nasa.gov) // Date: 25 June, 2018 // // OS-independent wrapper to lock out task switching. #ifndef _TaskLock_hpp_ #define _TaskLock_hpp_ #include <FpConfig.hpp> namespace Os { class TaskLock { public: static I32 lock(); //!< L...
hpp
fprime
data/projects/fprime/Os/Queue.hpp
/** * Queue.hpp: * * Queues are used internally to F prime in order to support the messaging between components. The * Queue class is used to abstract away from the standard OS-based queue, allowing F prime support * multiple OSes in a consistent way. * * Like most items in the OS package, the implementation is ...
hpp
fprime
data/projects/fprime/Os/QueueString.cpp
#include <Os/QueueString.hpp> #include <Fw/Types/StringUtils.hpp> namespace Os { QueueString::QueueString(const char* src) : StringBase() { (void) Fw::StringUtils::string_copy(this->m_buf, src, sizeof(this->m_buf)); } QueueString::QueueString(const StringBase& src) : StringBase() { (void...
cpp
fprime
data/projects/fprime/Os/IPCQueue.hpp
#ifndef _IPCQueue_hpp_ #define _IPCQueue_hpp_ #include <Os/Queue.hpp> namespace Os { class IPCQueue : public Os::Queue { public: IPCQueue(); ~IPCQueue(); QueueStatus create(const Fw::StringBase &name, NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize); //!< create a messa...
hpp
fprime
data/projects/fprime/Os/LogDefault.cpp
/** * LogDefault.cpp: * * This file ensures that the Os::Log has a default instance. This means it will be created in static space here, and * registered as the default implementation. If the user does not intend to use the default implementation of Os::Log, * then this file can safely be ignored. */ #include <Os...
cpp
fprime
data/projects/fprime/Os/File.hpp
// ====================================================================== // \title Os/File.hpp // \brief common function definitions for Os::File // ====================================================================== #ifndef Os_File_hpp_ #define Os_File_hpp_ #include <FpConfig.hpp> namespace Os { //! \brief b...
hpp
fprime
data/projects/fprime/Os/SystemResources.hpp
// ====================================================================== // \title SystemResources.hpp // \author mstarch // \brief hpp file for SystemResources component implementation class // // \copyright // Copyright 2021, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States Governm...
hpp
fprime
data/projects/fprime/Os/ValidateFileCommon.cpp
#include <Os/ValidateFile.hpp> #include <Os/File.hpp> #include <Utils/Hash/Hash.hpp> #include <Os/FileSystem.hpp> namespace Os { File::Status computeHash(const char* fileName, Utils::HashBuffer &hashBuffer) { File::Status status; // Open file: File file; status = file.open(fileNa...
cpp
fprime
data/projects/fprime/Os/IntervalTimerCommon.cpp
/** * IntervalTimerCommon.cpp: * * Contains the common functions for interval timer. This set of functions makes no assumption on * the format of the RawTime objects and thus it operates through functions that abstract that * implementation away, or it is working on the raw values, as raw values. * * *Note:* If ...
cpp
fprime
data/projects/fprime/Os/TaskId.hpp
// File: TaskId.hpp // Author: Ben Soudry (benjamin.s.soudry@jpl.nasa.gov) // Nathan Serafin (nathan.serafin@jpl.nasa.gov) // Date: 29 June, 2018 // // Define a type for task IDs. This is useful as POSIX only // provides an opaque TID with a special pthread_equal() comparison // function. For higher-level cod...
hpp
fprime
data/projects/fprime/Os/LogPrintf.cpp
/** * File: Os/LogPrintf.cpp * Description: an implementation on the Os::Log abstraction that routes log messages into standard * printf calls. */ #include <Os/Log.hpp> #include <cstdio> namespace Os { Log::Log() { // Register myself as a logger at construction time. If used in unison with LogDefault...
cpp
fprime
data/projects/fprime/Os/Mutex.hpp
#ifndef _Mutex_hpp_ #define _Mutex_hpp_ #include <FpConfig.hpp> namespace Os { class Mutex { public: Mutex(); //!< Constructor. Mutex is unlocked when created virtual ~Mutex(); //!< Destructor void lock(); //!< lock the mutex void unLock(); //!< unloc...
hpp
fprime
data/projects/fprime/Os/QueueString.hpp
#ifndef OS_QUEUE_STRING_TYPE_HPP #define OS_QUEUE_STRING_TYPE_HPP #include <FpConfig.hpp> #include <Fw/Types/StringType.hpp> namespace Os { class QueueString : public Fw::StringBase { public: QueueString(const char* src); //!< char buffer constructor QueueString(const StringBase&...
hpp
fprime
data/projects/fprime/Os/TaskString.cpp
#include <Os/TaskString.hpp> #include <Fw/Types/StringUtils.hpp> namespace Os { TaskString::TaskString(const char* src) : StringBase() { (void) Fw::StringUtils::string_copy(this->m_buf, src, sizeof(this->m_buf)); } TaskString::TaskString(const StringBase& src) : StringBase() { (void) Fw...
cpp
fprime
data/projects/fprime/Os/LocklessQueue.hpp
#ifndef _LOCKLESS_QUEUE_H_ #define _LOCKLESS_QUEUE_H_ #include <FpConfig.hpp> #include <Os/Queue.hpp> #ifndef BUILD_DARWIN // Allow compiling #include <mqueue.h> #endif namespace Os { class LocklessQueue { typedef struct QueueNode_s { U8 * data; NATIVE_INT_TYPE size; str...
hpp
fprime
data/projects/fprime/Os/WatchdogTimer.hpp
#ifndef _WatchdogTimer_hpp_ #define _WatchdogTimer_hpp_ #include <FpConfig.hpp> namespace Os { class WatchdogTimer { public: typedef enum { WATCHDOG_OK, //!< Call was successful WATCHDOG_INIT_ERROR, //!< Timer initialization failed WATCHDOG_STAR...
hpp
fprime
data/projects/fprime/Os/TaskString.hpp
#ifndef OS_TASK_STRING_TYPE_HPP #define OS_TASK_STRING_TYPE_HPP #include <FpConfig.hpp> #include <Fw/Types/StringType.hpp> namespace Os { class TaskString : public Fw::StringBase { public: TaskString(const char* src); //!< char buffer constructor TaskString(const StringBase& src)...
hpp
fprime
data/projects/fprime/Os/Event.hpp
// File: Event.hpp // Author: Nathan Serafin (nathan.serafin@jpl.nasa.gov) // Date: 27 July, 2018 // // OS-independent wrapper for events. #ifndef EVENT_HPP #define EVENT_HPP #include <FpConfig.hpp> #include <Os/TaskId.hpp> namespace Os { class Event { public: enum Timeout { E...
hpp
fprime
data/projects/fprime/Os/ValidateFile.hpp
/** * \file * \author R. Bocchino, K. Dinkel * \brief Defines a file class to validate files or generate a file validator file * * \copyright * Copyright 2009-2016, by the California Institute of Technology. * ALL RIGHTS RESERVED. United States Government Sponsorship * acknowledged. * */ #ifndef _ValidateFi...
hpp
fprime
data/projects/fprime/Os/MemCommon.cpp
#include <Os/Mem.hpp> #include <cstring> namespace Os { U32 Mem::virtToPhys(U32 virtAddr) { return virtAddr; } U32 Mem::physToVirt(U32 physAddr) { return physAddr; } }
cpp
fprime
data/projects/fprime/Os/QueueCommon.cpp
#include <Os/Queue.hpp> #include <Fw/Types/Assert.hpp> #include <cstring> namespace Os { #if FW_QUEUE_REGISTRATION QueueRegistry* Queue::s_queueRegistry = nullptr; #endif NATIVE_INT_TYPE Queue::s_numQueues = 0; Queue::QueueStatus Queue::send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priorit...
cpp
fprime
data/projects/fprime/Os/Log.hpp
/** * File: Os/Log.hpp * Description: this file provides an implementation of the Fw::Logger class that is backed by the * Os abstraction layer. */ #ifndef _Log_hpp_ #define _Log_hpp_ #include <FpConfig.hpp> #include <Fw/Logger/Logger.hpp> namespace Os { class Log : public Fw::Logger { public: ...
hpp
fprime
data/projects/fprime/Os/FileSystem.hpp
#ifndef _FileSystem_hpp_ #define _FileSystem_hpp_ #include <FpConfig.hpp> #include <Fw/Types/String.hpp> #define FILE_SYSTEM_CHUNK_SIZE (256u) namespace Os { // This namespace encapsulates a very simple file system interface that has the most often-used features. namespace FileSystem { typedef enum { OP_OK,...
hpp
fprime
data/projects/fprime/Os/TaskIdRepr.hpp
// File: TaskIdRepr.hpp // Author: Nathan Serafin (nathan.serafin@jpl.nasa.gov) // Date: 29 June, 2018 // // Depending on the target operating system, define a type // for the storage of task IDs. #ifndef TASKIDREPR_HPP #define TASKIDREPR_HPP #if defined(TGT_OS_TYPE_LINUX) || defined(TGT_OS_TYPE_DARWIN) extern "C" { ...
hpp
fprime
data/projects/fprime/Os/IntervalTimer.hpp
/** * IntervalTimer.hpp: * * Interval timer provides timing over a set interval to the caller. It is one of the core Os * package supplied items. */ #ifndef _IntervalTimer_hpp_ #define _IntervalTimer_hpp_ #include <FpConfig.hpp> namespace Os { class IntervalTimer { public: /** * RawTime:...
hpp
fprime
data/projects/fprime/Os/Linux/File.cpp
#include <FpConfig.hpp> #include <Os/File.hpp> #include <Fw/Types/Assert.hpp> #ifdef __cplusplus extern "C" { #endif // __cplusplus #include <Utils/Hash/libcrc/lib_crc.h> // borrow CRC #ifdef __cplusplus } #endif // __cplusplus #include <cerrno> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #inclu...
cpp
fprime
data/projects/fprime/Os/Linux/SystemResources.cpp
// ====================================================================== // \title Linux/SystemResources.cpp // \author sfregoso // \brief hpp file for SystemResources component implementation class // // \copyright // Copyright 2021, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States ...
cpp
fprime
data/projects/fprime/Os/Linux/FileSystem.cpp
#include <FpConfig.hpp> #include <Fw/Types/Assert.hpp> #include <Os/File.hpp> #include <Os/FileSystem.hpp> #include <dirent.h> #include <sys/stat.h> #include <sys/statvfs.h> #include <unistd.h> #include <cerrno> #include <cstdio> // Needed for rename #include <cstring> #include <limits> namespace Os { namespace Fil...
cpp
fprime
data/projects/fprime/Os/Linux/Directory.cpp
#include <FpConfig.hpp> #include <Os/Directory.hpp> #include <Fw/Types/Assert.hpp> #include <dirent.h> #include <cerrno> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <cstring> namespace Os { Directory::Directory() :m_dir(0),m_lastError(0) { } Directory::~...
cpp
fprime
data/projects/fprime/Os/Linux/InterruptLock.cpp
#include <Os/InterruptLock.hpp> #include <Os/Mutex.hpp> STATIC Os::Mutex intLockEmulator; namespace Os { InterruptLock::InterruptLock() : m_key(0) {} InterruptLock::~InterruptLock() {} void InterruptLock::lock() { intLockEmulator.lock(); } void InterruptLock::unLock() { intLockEm...
cpp
fprime
data/projects/fprime/Os/Linux/WatchdogTimer.cpp
#include <Os/WatchdogTimer.hpp> #include <Fw/Types/Assert.hpp> namespace Os { WatchdogTimer::WatchdogTimer() : m_handle(0),m_cb(nullptr),m_parameter(nullptr),m_timerTicks(0),m_timerMs(0) { } WatchdogTimer::~WatchdogTimer() { } WatchdogTimer::WatchdogStatus WatchdogTimer::startTicks( I32 ...
cpp
fprime
data/projects/fprime/Os/MacOs/IPCQueueStub.cpp
// ====================================================================== // \title Queue.cpp // \author dinkel // \brief Queue implementation using the pthread library. This is NOT // an IPC queue. It is meant to be used between threads within // the same address space. // // \copyright // Copyright ...
cpp
fprime
data/projects/fprime/Os/MacOs/SystemResources.cpp
// ====================================================================== // \title MacOs/SystemResources.cpp // \author mstarch // \brief hpp file for SystemResources component implementation class // // \copyright // Copyright 2021, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States G...
cpp
fprime
data/projects/fprime/Os/X86/IntervalTimer.cpp
/** * X86/IntervalTimer.cpp: * * This file supports the core functions of the IntervalTimer for X86 implementations that support * the following specification for the "RawTime" object: * * RawTime.lower = nanoseconds of time * RawTime.upper = seconds of time. * * Any implementation that fills "RawTime" via thi...
cpp
fprime
data/projects/fprime/Os/Models/Models.hpp
// ====================================================================== // \title Os/Models/Models.hpp // \brief header used to validate Os/Models before use // ====================================================================== #include "Os/Models/FileStatusEnumAc.hpp" #include "Os/Models/FileModeEnumAc.hpp" #i...
hpp
fprime
data/projects/fprime/Os/Pthreads/BufferQueueCommon.cpp
// ====================================================================== // \title BufferQueueCommon.hpp // \author dinkel // \brief This file implements some of the methods for the generic // buffer queue data structure declared in BufferQueue.hpp that // are common amongst different queue implement...
cpp
fprime
data/projects/fprime/Os/Pthreads/Queue.cpp
// ====================================================================== // \title Queue.cpp // \author dinkel // \brief Queue implementation using the pthread library. This is NOT // an IPC queue. It is meant to be used between threads within // the same address space. // // \copyright // Copyright ...
cpp
fprime
data/projects/fprime/Os/Pthreads/BufferQueue.hpp
// ====================================================================== // \title BufferQueue.hpp // \author dinkel // \brief A generic buffer queue data structure. // // \copyright // Copyright 2009-2015, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponsorship // ac...
hpp
fprime
data/projects/fprime/Os/Pthreads/PriorityBufferQueue.cpp
// ====================================================================== // \title PriorityBufferQueue.hpp // \author dinkel // \brief An implementation of BufferQueue which uses a stable max heap // data structure for the queue. Items of highest priority will // be popped off of the queue first. Ite...
cpp
fprime
data/projects/fprime/Os/Pthreads/FIFOBufferQueue.cpp
// ====================================================================== // \title FIFOBufferQueue.hpp // \author dinkel // \brief An implementation of BufferQueue which uses a FIFO data // structure for the queue. Priority is ignored. // // \copyright // Copyright 2009-2015, by the California Institute of T...
cpp
fprime
data/projects/fprime/Os/Pthreads/MaxHeap/MaxHeap.cpp
// ====================================================================== // \title MaxHeap.cpp // \author dinkel // \brief An implementation of a stable max heap data structure. Items // popped off the heap are guaranteed to be in order of decreasing // "value" (max removed first). Items of equal "va...
cpp
fprime
data/projects/fprime/Os/Pthreads/MaxHeap/MaxHeap.hpp
// ====================================================================== // \title MaxHeap.hpp // \author dinkel // \brief An implementation of a stable max heap data structure // // \copyright // Copyright 2009-2015, by the California Institute of Technology. // ALL RIGHTS RESERVED. United States Government Sponso...
hpp
fprime
data/projects/fprime/Os/Pthreads/MaxHeap/test/ut/MaxHeapTest.cpp
#include "Os/Pthreads/MaxHeap/MaxHeap.hpp" #include <Fw/Types/Assert.hpp> #include <cstdio> #include <cstring> using namespace Os; #define DEPTH 5 #define DATA_SIZE 3 int main() { printf("Creating heap.\n"); bool ret; MaxHeap heap; ret = heap.create(0); FW_ASSERT(ret, ret); ret = heap.create(1000000); F...
cpp
fprime
data/projects/fprime/Os/Pthreads/test/ut/BufferQueueTest.cpp
#include "Os/Pthreads/BufferQueue.hpp" #include <Fw/Types/Assert.hpp> #include <cstdio> #include <cstring> using namespace Os; // Set this to 1 if testing a priority queue // Set this to 0 if testing a fifo queue #define PRIORITY_QUEUE 1 #define DEPTH 5 #define MSG_SIZE 3 int main() { printf("Creating queue.\n"); ...
cpp
fprime
data/projects/fprime/Os/Stub/File.cpp
// ====================================================================== // \title Os/Stub/File.cpp // \brief stub implementation for Os::File // ====================================================================== #include "Os/Stub/File.hpp" namespace Os { namespace Stub { namespace File { StubFile::Status St...
cpp