HRCore V1.1.0
A High Resolution Calculation Library
Loading...
Searching...
No Matches
HRCore::Storage::Interface Class Referenceabstract

A class as a storage interface, pure virtual. More...

#include <StorageIF.hpp>

Inheritance diagram for HRCore::Storage::Interface:
Inheritance graph

Classes

struct  item_t
 Storage item descriptor. More...
 

Public Member Functions

virtual item_t begin ()=0
 Return the first item of storage. More...
 
virtual item_t end ()=0
 Returns the last item of storage. More...
 
virtual item_t next (item_t cur)=0
 Get next item. More...
 
virtual item_t prev (item_t cur)=0
 
virtual item_t at (size_t pos)=0
 Access to storage[pos]. More...
 
virtual size_t length ()=0
 Get the length of storage. More...
 
virtual bool shrink (size_t len)=0
 Remove data from the end to shrink the size to a given length. More...
 
virtual bool extend (size_t len)=0
 Extend the storage to a given length. More...
 
virtual InterfacenewObject ()=0
 Get a new object of same type. More...
 
virtual void delObject (const Interface *ptr)=0
 Delete a object from newObject() More...
 

Detailed Description

A class as a storage interface, pure virtual.

Definition at line 28 of file StorageIF.hpp.

Member Function Documentation

◆ at()

virtual item_t HRCore::Storage::Interface::at ( size_t  pos)
pure virtual

Access to storage[pos].

Parameters
posThe index of item, starting from 0.
Returns
item_t

Implemented in HRCore::Storage::VirtualMMU< N >, and HRCore::Storage::LinkedList< N >.

◆ begin()

virtual item_t HRCore::Storage::Interface::begin ( )
pure virtual

Return the first item of storage.

Returns
item_t The first item.

Implemented in HRCore::Storage::LinkedList< N >, and HRCore::Storage::VirtualMMU< N >.

Here is the caller graph for this function:

◆ delObject()

virtual void HRCore::Storage::Interface::delObject ( const Interface ptr)
pure virtual

Delete a object from newObject()

Parameters
ptrThe pointer of object to be deleted

Implemented in HRCore::Storage::LinkedList< N >, and HRCore::Storage::VirtualMMU< N >.

Here is the caller graph for this function:

◆ end()

virtual item_t HRCore::Storage::Interface::end ( )
pure virtual

Returns the last item of storage.

Returns
item_t The last item.

Implemented in HRCore::Storage::LinkedList< N >, and HRCore::Storage::VirtualMMU< N >.

Here is the caller graph for this function:

◆ extend()

virtual bool HRCore::Storage::Interface::extend ( size_t  len)
pure virtual

Extend the storage to a given length.

Parameters
lenFinal length.
Returns
true if success
false if no space or ...

Implemented in HRCore::Storage::VirtualMMU< N >, and HRCore::Storage::LinkedList< N >.

Here is the caller graph for this function:

◆ length()

virtual size_t HRCore::Storage::Interface::length ( )
pure virtual

Get the length of storage.

Returns
size_t Length of storage

Implemented in HRCore::Storage::LinkedList< N >, and HRCore::Storage::VirtualMMU< N >.

Here is the caller graph for this function:

◆ newObject()

virtual Interface * HRCore::Storage::Interface::newObject ( )
pure virtual

Get a new object of same type.

Returns
Interface* The pointer of new object

Implemented in HRCore::Storage::LinkedList< N >, and HRCore::Storage::VirtualMMU< N >.

Here is the caller graph for this function:

◆ next()

virtual item_t HRCore::Storage::Interface::next ( item_t  cur)
pure virtual

Get next item.

Parameters
curCurrent item.
Returns
item_t The next item.

Implemented in HRCore::Storage::VirtualMMU< N >, and HRCore::Storage::LinkedList< N >.

Here is the caller graph for this function:

◆ prev()

virtual item_t HRCore::Storage::Interface::prev ( item_t  cur)
pure virtual
Parameters
curCurrent item.
Returns
item_t The previous item.

Implemented in HRCore::Storage::VirtualMMU< N >, and HRCore::Storage::LinkedList< N >.

Here is the caller graph for this function:

◆ shrink()

virtual bool HRCore::Storage::Interface::shrink ( size_t  len)
pure virtual

Remove data from the end to shrink the size to a given length.

Parameters
lenThe length to be remained.
Returns
true if success
false if failed

Implemented in HRCore::Storage::VirtualMMU< N >, and HRCore::Storage::LinkedList< N >.


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