IFS::FWFS::ObjectStore Class Reference

object store for read-only filesystem More...

#include <ObjectStore.h>

Inheritance diagram for IFS::FWFS::ObjectStore:
[legend]
Collaboration diagram for IFS::FWFS::ObjectStore:
[legend]

Public Member Functions

 ObjectStore (Storage::Partition partition)
 
int initialise () override
 called by FWFS More...
 
int mounted (const FWObjDesc &od) override
 called by FWFS to confirm successful mount More...
 
bool isMounted () override
 determine if store is mounted More...
 
int open (FWObjDesc &od) override
 find an object and return a descriptor for it More...
 
int openChild (const FWObjDesc &parent, const FWObjDesc &child, FWObjDesc &od) override
 open a descriptor for a child object More...
 
int readHeader (FWObjDesc &od) override
 read a root object header More...
 
int readChildHeader (const FWObjDesc &parent, FWObjDesc &child) override
 fetch child object header More...
 
int readContent (const FWObjDesc &od, uint32_t offset, uint32_t size, void *buffer) override
 read object content More...
 
int close (FWObjDesc &od) override
 close an object descriptor More...
 
Storage::PartitiongetPartition () override
 
- Public Member Functions inherited from IFS::IObjectStore
virtual ~IObjectStore ()
 

Detailed Description

object store for read-only filesystem

Constructor & Destructor Documentation

◆ ObjectStore()

IFS::FWFS::ObjectStore::ObjectStore ( Storage::Partition  partition)
inline

Member Function Documentation

◆ close()

int IFS::FWFS::ObjectStore::close ( FWObjDesc od)
overridevirtual

close an object descriptor

Parameters
od
Return values
interror code
Note
the implementation should free any allocated resources

Implements IFS::IObjectStore.

◆ getPartition()

Storage::Partition& IFS::FWFS::ObjectStore::getPartition ( )
inlineoverridevirtual

Implements IFS::IObjectStore.

◆ initialise()

int IFS::FWFS::ObjectStore::initialise ( )
overridevirtual

called by FWFS

Return values
errorcode

Implements IFS::IObjectStore.

◆ isMounted()

bool IFS::FWFS::ObjectStore::isMounted ( )
inlineoverridevirtual

determine if store is mounted

Return values
trueif mounted

Implements IFS::IObjectStore.

◆ mounted()

int IFS::FWFS::ObjectStore::mounted ( const FWObjDesc od)
overridevirtual

called by FWFS to confirm successful mount

Parameters
odlast object (the end marker)
Return values
interror code

Implements IFS::IObjectStore.

◆ open()

int IFS::FWFS::ObjectStore::open ( FWObjDesc od)
overridevirtual

find an object and return a descriptor for it

Parameters
odIN/OUT: resolved object
Return values
interror code
Note
od.ref must be initialised

Implements IFS::IObjectStore.

◆ openChild()

int IFS::FWFS::ObjectStore::openChild ( const FWObjDesc parent,
const FWObjDesc child,
FWObjDesc od 
)
overridevirtual

open a descriptor for a child object

Parameters
parent
childreference to child, relative to parent
odOUT: resolved object
Return values
interror code

Implements IFS::IObjectStore.

◆ readChildHeader()

int IFS::FWFS::ObjectStore::readChildHeader ( const FWObjDesc parent,
FWObjDesc child 
)
overridevirtual

fetch child object header

Parameters
parent
childuninitialised child, returns result
Return values
errorcode
Note
references are not pursued; the caller must handle that child.ref refers to position relative to parent Implementations must set child.storenum = parent.storenum; other values will be meaningless as object stores are unaware of other stores.

Implements IFS::IObjectStore.

◆ readContent()

int IFS::FWFS::ObjectStore::readContent ( const FWObjDesc od,
uint32_t  offset,
uint32_t  size,
void *  buffer 
)
overridevirtual

read object content

Parameters
offsetlocation to start reading, from start of object content
sizebytes to read
bufferto store data
Return values
numberof bytes read, or error code
Note
must fail if cannot read all requested bytes

Implements IFS::IObjectStore.

◆ readHeader()

int IFS::FWFS::ObjectStore::readHeader ( FWObjDesc od)
overridevirtual

read a root object header

Parameters
odobject descriptor, with offset and ID fields initialised
Return values
errorcode
Note
this method deals with top-level objects only

Implements IFS::IObjectStore.


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