F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Os::ConsoleInterface Class Referenceabstract

#include <Os/Console.hpp>

Inheritance diagram for Os::ConsoleInterface:
Os::Console Os::Posix::Console::PosixConsole Os::Stub::Console::StubConsole

Public Member Functions

 ConsoleInterface ()=default
 Default constructor. More...
 
virtual ~ConsoleInterface ()=default
 Default destructor. More...
 
virtual void writeMessage (const CHAR *message, const FwSizeType size)=0
 write message to console More...
 
virtual ConsoleHandlegetHandle ()=0
 returns the raw console handle More...
 

Static Public Member Functions

static ConsoleInterfacegetDelegate (ConsoleHandleStorage &aligned_placement_new_memory, const ConsoleInterface *to_copy=nullptr)
 provide a pointer to a console delegate object More...
 

Detailed Description

Definition at line 19 of file Console.hpp.

Constructor & Destructor Documentation

◆ ConsoleInterface()

Os::ConsoleInterface::ConsoleInterface ( )
default

Default constructor.

◆ ~ConsoleInterface()

virtual Os::ConsoleInterface::~ConsoleInterface ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ getDelegate()

ConsoleInterface * Os::ConsoleInterface::getDelegate ( ConsoleHandleStorage aligned_placement_new_memory,
const ConsoleInterface to_copy = nullptr 
)
static

provide a pointer to a console delegate object

This function must return a pointer to a ConsoleInterface object that contains the real implementation of the console functions as defined by the implementor. This function must do several things to be considered correctly implemented:

  1. Assert that their implementation fits within FW_HANDLE_MAX_SIZE. e.g. static_assert(sizeof(PosixFileImplementation) <= sizeof Os::File::m_handle_storage, "FW_HANDLE_MAX_SIZE too small");
  2. Assert that their implementation aligns within FW_HANDLE_ALIGNMENT. e.g. static_assert((FW_HANDLE_ALIGNMENT % alignof(PosixFileImplementation)) == 0, "Bad handle alignment");
  3. If to_copy is null, placement new their implementation into aligned_placement_new_memory e.g. FileInterface* interface = new (aligned_placement_new_memory) PosixFileImplementation;
  4. If to_copy is non-null, placement new using copy constructor their implementation into aligned_placement_new_memory e.g. FileInterface* interface = new (aligned_placement_new_memory) PosixFileImplementation(*to_copy);
  5. Return the result of the placement new e.g. return interface;
Returns
result of placement new, must be equivalent to aligned_placement_new_memory

Definition at line 10 of file DefaultConsole.cpp.

◆ getHandle()

virtual ConsoleHandle* Os::ConsoleInterface::getHandle ( )
pure virtual

returns the raw console handle

Gets the raw console handle from the implementation. Note: users must include the implementation specific header to make any real use of this handle. Otherwise it will be as an opaque type.

Returns
raw console handle

Implemented in Os::Stub::Console::StubConsole, Os::Posix::Console::PosixConsole, and Os::Console.

◆ writeMessage()

virtual void Os::ConsoleInterface::writeMessage ( const CHAR message,
const FwSizeType  size 
)
pure virtual

write message to console

Write a message to the console with a bounded size.

Parameters
messageraw message to write
sizesize of the message to write to the console

Implemented in Os::Stub::Console::StubConsole, Os::Posix::Console::PosixConsole, and Os::Console.


The documentation for this class was generated from the following files: