F´ Flight Software - C/C++ Documentation  devel
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/Stub/File.hpp"
6 #include "Os/Stub/FileSystem.hpp"
7 #include "Os/Stub/Directory.hpp"
8 #include "Os/Delegate.hpp"
9 namespace Os {
10 
15 FileInterface *FileInterface::getDelegate(FileHandleStorage& aligned_placement_new_memory, const FileInterface* to_copy) {
16  return Os::Delegate::makeDelegate<FileInterface, Os::Stub::File::StubFile>(
17  aligned_placement_new_memory, to_copy
18  );
19 }
20 
25 FileSystemInterface *FileSystemInterface::getDelegate(FileSystemHandleStorage& aligned_placement_new_memory) {
26  return Os::Delegate::makeDelegate<FileSystemInterface, Os::Stub::FileSystem::StubFileSystem>(
27  aligned_placement_new_memory
28  );
29 }
30 
34 DirectoryInterface *DirectoryInterface::getDelegate(DirectoryHandleStorage& aligned_placement_new_memory) {
35  return Os::Delegate::makeDelegate<DirectoryInterface, Os::Stub::Directory::StubDirectory>(
36  aligned_placement_new_memory
37  );
38 }
39 }
U8 DirectoryHandleStorage[FW_DIRECTORY_HANDLE_MAX_SIZE]
Definition: Os.hpp:15
U8 FileSystemHandleStorage[FW_FILESYSTEM_HANDLE_MAX_SIZE]
Definition: Os.hpp:16
U8 FileHandleStorage[FW_FILE_HANDLE_MAX_SIZE]
Definition: Os.hpp:13
static DirectoryInterface * getDelegate(DirectoryHandleStorage &aligned_new_memory)
provide a pointer to a Directory delegate object
Definition: DefaultFile.cpp:20
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 FileSystemInterface * getDelegate(FileSystemHandleStorage &aligned_new_memory)
provide a pointer to a FileSystem delegate object
Definition: DefaultFile.cpp:17