FreeNOS
Public Member Functions | Private Member Functions | Private Attributes
BootSymbolStorage Class Reference

Uses a BootSymbol inside a BootImage as a storage provider. More...

#include <BootSymbolStorage.h>

Inheritance diagram for BootSymbolStorage:
Storage

Public Member Functions

 BootSymbolStorage (const BootImageStorage &bootImage, const char *symbolName)
 Constructor function. More...
 
virtual FileSystem::Result initialize ()
 Initialize the Storage device. More...
 
virtual FileSystem::Result read (const u64 offset, void *buffer, const Size size) const
 Reads data from the BootSymbol. More...
 
virtual u64 capacity () const
 Retrieve maximum storage capacity. More...
 
- Public Member Functions inherited from Storage
 Storage ()
 Constructor function. More...
 
virtual ~Storage ()
 Destructor function. More...
 
virtual FileSystem::Result write (const u64 offset, void *buffer, const Size size)
 Write a contiguous set of data. More...
 

Private Member Functions

const BootSymbol loadSymbol (const char *name) const
 Loads the BootSymbol from the BootImage. More...
 
const BootSegment loadSegment (const BootSymbol &symbol) const
 Load the BootSegment for the given BootSymbol. More...
 

Private Attributes

const BootImageStoragem_bootImage
 Read-only reference to the BootImage storage. More...
 
const BootSymbol m_symbol
 BootSymbol value. More...
 
const BootSegment m_segment
 BootSegment value. More...
 

Detailed Description

Uses a BootSymbol inside a BootImage as a storage provider.

Definition at line 39 of file BootSymbolStorage.h.

Constructor & Destructor Documentation

◆ BootSymbolStorage()

BootSymbolStorage::BootSymbolStorage ( const BootImageStorage bootImage,
const char *  symbolName 
)

Constructor function.

Parameters
bootImageBootImageStorage to use for I/O.
symbolNameName of the BootSymbol entry to use.

Definition at line 22 of file BootSymbolStorage.cpp.

Member Function Documentation

◆ capacity()

u64 BootSymbolStorage::capacity ( ) const
virtual

Retrieve maximum storage capacity.

Returns
Storage capacity.

Implements Storage.

Definition at line 47 of file BootSymbolStorage.cpp.

References m_symbol, and BootSymbol::segmentsTotalSize.

◆ initialize()

FileSystem::Result BootSymbolStorage::initialize ( )
virtual

Initialize the Storage device.

Returns
Result code

Implements Storage.

Definition at line 30 of file BootSymbolStorage.cpp.

References FileSystem::IOError, m_segment, m_symbol, BootSegment::offset, BootSymbol::segmentsTotalSize, and FileSystem::Success.

Referenced by main().

◆ loadSegment()

const BootSegment BootSymbolStorage::loadSegment ( const BootSymbol symbol) const
private

◆ loadSymbol()

const BootSymbol BootSymbolStorage::loadSymbol ( const char *  name) const
private

◆ read()

FileSystem::Result BootSymbolStorage::read ( const u64  offset,
void *  buffer,
const Size  size 
) const
virtual

Reads data from the BootSymbol.

Parameters
offsetOffset to start reading from.
bufferOutput buffer.
sizeNumber of bytes to copied.
Returns
Result code

Implements Storage.

Definition at line 42 of file BootSymbolStorage.cpp.

References m_bootImage, m_segment, BootSegment::offset, and BootImageStorage::read().

Field Documentation

◆ m_bootImage

const BootImageStorage& BootSymbolStorage::m_bootImage
private

Read-only reference to the BootImage storage.

Definition at line 98 of file BootSymbolStorage.h.

Referenced by loadSegment(), loadSymbol(), and read().

◆ m_segment

const BootSegment BootSymbolStorage::m_segment
private

BootSegment value.

Definition at line 104 of file BootSymbolStorage.h.

Referenced by initialize(), and read().

◆ m_symbol

const BootSymbol BootSymbolStorage::m_symbol
private

BootSymbol value.

Definition at line 101 of file BootSymbolStorage.h.

Referenced by capacity(), and initialize().


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