| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | |||
| 11 | //! \brief get a delegate for FileInterface that intercepts calls for stub file usage | ||
| 12 | //! \param aligned_new_memory: aligned memory to fill | ||
| 13 | //! \param to_copy: pointer to copy-constructor input | ||
| 14 | //! \return: pointer to delegate | ||
| 15 | 1 | FileInterface* FileInterface::getDelegate(FileHandleStorage& aligned_placement_new_memory, | |
| 16 | const FileInterface* to_copy) { | ||
| 17 | 1 | return Os::Delegate::makeDelegate<FileInterface, Os::Stub::File::StubFile>(aligned_placement_new_memory, to_copy); | |
| 18 | } | ||
| 19 | |||
| 20 | //! \brief get a delegate for FileSystemInterface that intercepts calls for stub fileSystem usage | ||
| 21 | //! \param aligned_new_memory: aligned memory to fill | ||
| 22 | //! \param to_copy: pointer to copy-constructor input | ||
| 23 | //! \return: pointer to delegate | ||
| 24 | 1 | FileSystemInterface* FileSystemInterface::getDelegate(FileSystemHandleStorage& aligned_placement_new_memory) { | |
| 25 | 1 | return Os::Delegate::makeDelegate<FileSystemInterface, Os::Stub::FileSystem::StubFileSystem>( | |
| 26 | 1 | aligned_placement_new_memory); | |
| 27 | } | ||
| 28 | |||
| 29 | //! \brief get a delegate for DirectoryInterface that intercepts calls for stub Directory usage | ||
| 30 | //! \param aligned_new_memory: aligned memory to fill | ||
| 31 | //! \return: pointer to delegate | ||
| 32 | 1 | DirectoryInterface* DirectoryInterface::getDelegate(DirectoryHandleStorage& aligned_placement_new_memory) { | |
| 33 | 1 | return Os::Delegate::makeDelegate<DirectoryInterface, Os::Stub::Directory::StubDirectory>( | |
| 34 | 1 | aligned_placement_new_memory); | |
| 35 | } | ||
| 36 | } // namespace Os | ||
| 37 |