11#ifndef __HRCORE_STORAGEIF__HPP__
12#define __HRCORE_STORAGEIF__HPP__
33 ival_t* data =
nullptr;
39 explicit operator bool() const noexcept {
return (data !=
nullptr); }
A class as a storage interface, pure virtual.
virtual Interface * newObject()=0
Get a new object of same type.
virtual size_t length()=0
Get the length of storage.
virtual void delObject(const Interface *ptr)=0
Delete a object from newObject()
virtual item_t at(size_t pos)=0
Access to storage[pos].
virtual bool shrink(size_t len)=0
Remove data from the end to shrink the size to a given length.
virtual bool extend(size_t len)=0
Extend the storage to a given length.
virtual item_t next(item_t cur)=0
Get next item.
virtual item_t end()=0
Returns the last item of storage.
virtual item_t begin()=0
Return the first item of storage.
virtual item_t prev(item_t cur)=0
HRCore main namespace, contains all classes.
void * appendix
Store an appendix pointer.
size_t index
Store the index of data.