F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DefaultFile.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Stub/DefaultFile.cpp
3 // \brief sets default Os::File to no-op stub implementation via linker
4 // ======================================================================
5 #include "Os/Delegate.hpp"
6 #include "Os/Stub/Directory.hpp"
7 #include "Os/Stub/File.hpp"
8 #include "Os/Stub/FileSystem.hpp"
9 namespace Os {
10 
15 FileInterface* FileInterface::getDelegate(FileHandleStorage& aligned_placement_new_memory,
16  const FileInterface* to_copy) {
17  return Os::Delegate::makeDelegate<FileInterface, Os::Stub::File::StubFile>(aligned_placement_new_memory, to_copy);
18 }
19 
24 FileSystemInterface* FileSystemInterface::getDelegate(FileSystemHandleStorage& aligned_placement_new_memory) {
25  return Os::Delegate::makeDelegate<FileSystemInterface, Os::Stub::FileSystem::StubFileSystem>(
26  aligned_placement_new_memory);
27 }
28 
32 DirectoryInterface* DirectoryInterface::getDelegate(DirectoryHandleStorage& aligned_placement_new_memory) {
33  return Os::Delegate::makeDelegate<DirectoryInterface, Os::Stub::Directory::StubDirectory>(
34  aligned_placement_new_memory);
35 }
36 } // namespace Os
U8 DirectoryHandleStorage[FW_DIRECTORY_HANDLE_MAX_SIZE]
Definition: Os.hpp:15
static FileSystemInterface * getDelegate(FileSystemHandleStorage &aligned_new_memory)
provide a pointer to a FileSystem delegate object
Definition: DefaultFile.cpp:17
U8 FileSystemHandleStorage[FW_FILESYSTEM_HANDLE_MAX_SIZE]
Definition: Os.hpp:16
U8 FileHandleStorage[FW_FILE_HANDLE_MAX_SIZE]
Definition: Os.hpp:13
static FileInterface * getDelegate(FileHandleStorage &aligned_placement_new_memory, const FileInterface *to_copy=nullptr)
provide a pointer to a file delegate object
Definition: DefaultFile.cpp:14
static DirectoryInterface * getDelegate(DirectoryHandleStorage &aligned_new_memory)
provide a pointer to a Directory delegate object
Definition: DefaultFile.cpp:20