Public Member Functions | Static Public Member Functions | List of all members
Celartem::MemoryStorage Class Referenceabstract

#include <cel_storage.h>

Inheritance diagram for Celartem::MemoryStorage:
Inheritance graph
[legend]

Public Member Functions

virtual SimpleArray< u8 > & getArray ()=0
 
virtual void setAllocationUnit (size_t inAllocationUnitInBytes)=0
 
virtual void setReadOnly (bool inReadOnly)=0
 
virtual bool isOwnMemory () const =0
 
virtual void makeOwnCopy ()=0
 
virtual void retain (Referable *inReferable)=0
 
- Public Member Functions inherited from Celartem::Storage
virtual uint64_t getSize () const =0
 
virtual uint64_t getPos () const =0
 
virtual void reserve (uint64_t inReservationSize)=0
 
virtual void setPos (uint64_t inPosition)=0
 
virtual void setPosRelative (int64_t inPosition)=0
 
virtual void setPosFromEnd (int64_t inPosition)=0
 
virtual void setEof ()=0
 
virtual String getStorageId () const =0
 
virtual AutoPtr< Storageduplicate () const =0
 
virtual Time getLastUpdateTime () const =0
 
- Public Member Functions inherited from Celartem::Stream
virtual size_t readBytes (void *buffer, size_t inSize, bool wouldBlock=false)=0
 
virtual void writeBytes (const void *buffer, size_t inSize)=0
 
virtual void flushBuffer ()=0
 
virtual bool isEof () const =0
 
virtual size_t duplicateStream (Stream *inStream, size_t inBufferSize=1024, DuplicateStreamCallback inCallback=NULL, void *inCallbackContext=NULL)
 
virtual size_t duplicateStreamBytes (Stream *inStream, size_t inMaximumByteSize, size_t inBufferSize=1024, DuplicateStreamCallback inCallback=NULL, void *inCallbackContext=NULL)
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 
- Public Member Functions inherited from Celartem::Lockable
virtual void lock () const =0
 
virtual void unlock () const =0
 

Static Public Member Functions

static AutoPtr< MemoryStoragecreate (SimpleArray< u8 > &inMemory, const Referable *inReferable=NULL)
 
static AutoPtr< MemoryStoragecreate (const SimpleArray< u8 > &inMemory, const Referable *inReferable=NULL)
 
static AutoPtr< MemoryStoragecreate ()
 
static AutoPtr< MemoryStoragecreate (const void *inData, size_t inDataSize, Endian inEndian=endianHost)
 
- Static Public Member Functions inherited from Celartem::Storage
static AutoPtr< Storagecreate (const String &inUriOrFileName, bool inLateBinding=false, ResourceBroker *inBroker=NULL)
 
static AutoPtr< StoragecreateTempNoLock ()
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

This class provides the feature of creating writable storage upon SimpleArray <u8> instance.

See Also
storages, RomStorage

Member Function Documentation

static AutoPtr<MemoryStorage> Celartem::MemoryStorage::create ( SimpleArray< u8 > &  inMemory,
const Referable inReferable = NULL 
)
static

This method creates Memory based R/W Storage.

Parameters
inMemoryA memory to access with the storage to create.
inReferableAn optional parameter, which specifies a Referable instance to retain on the instance.
Returns
Pointer to the newly created storage.
static AutoPtr<MemoryStorage> Celartem::MemoryStorage::create ( const SimpleArray< u8 > &  inMemory,
const Referable inReferable = NULL 
)
static

This method creates Memory based read only Storage.

Parameters
inMemoryA memory to access with the storage to create.
inReferableAn optional parameter, which specifies a Referable instance to retain on the instance.
Returns
Pointer to the newly created storage.
static AutoPtr<MemoryStorage> Celartem::MemoryStorage::create ( )
static

This method creates Memory Based R/W Storage. It creates an SimpleArray <u8> instance internally and you can obtain it by getArray function.

Returns
Pointer to the newly created storage.

Referenced by Celartem::DjVu::MemoryData::getReadOnlyStorage(), and Celartem::DjVu::MemoryData::getStorage().

static AutoPtr<MemoryStorage> Celartem::MemoryStorage::create ( const void *  inData,
size_t  inDataSize,
Endian  inEndian = endianHost 
)
static

This method creates Memory Based R/W Storage. It creates an SimpleArray <u8> instance internally using the specified buffer (duplicate the buffer data) and you can obtain it by getArray function.

Parameters
inDataPointer to the buffer of the initial data.
inDataSizeThe size of the buffer.
inEndianThe endianness of the specified buffer.
Returns
Pointer to the newly created storage.
virtual SimpleArray<u8>& Celartem::MemoryStorage::getArray ( )
pure virtual

This method returns the array which is used in this MemoryStorage instance.

Returns
Reference to the SimpleArray <u8> instance.
virtual bool Celartem::MemoryStorage::isOwnMemory ( ) const
pure virtual

This method determines whether the instance owns the memory block.

Returns
true if it owns the memory block; otherwise false.
virtual void Celartem::MemoryStorage::makeOwnCopy ( )
pure virtual

This method duplicates the associated memory to the instance.

virtual void Celartem::MemoryStorage::retain ( Referable inReferable)
pure virtual

This method assodicates a Referable.

Parameters
inReferableA Referable instance; it can be NULL.
virtual void Celartem::MemoryStorage::setAllocationUnit ( size_t  inAllocationUnitInBytes)
pure virtual

This method is to set the memory allocation unit. It controls the memory effeciency and the speed. A large value results in the good speed but the drawback is the bad memory effeciency.

Parameters
inAllocationUnitInBytesThe memory allocation unit in bytes.
See Also
SimpleArray::setAllocationUnit
virtual void Celartem::MemoryStorage::setReadOnly ( bool  inReadOnly)
pure virtual

This method makes the storage read-only.

Parameters
inReadOnlytrue to make the storage read-only; otherwise the storage can be writable.

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo