NCBI C++ ToolKit
|
Search Toolkit Book for IBlobStorage
Blob Storage interface. More...
#include <corelib/blob_storage.hpp>
Public Types | |
enum | ELockMode { eLockWait , eLockNoWait } |
Public Member Functions | |
virtual | ~IBlobStorage () |
virtual bool | IsKeyValid (const string &str)=0 |
Check if a given string is a valid key. More... | |
virtual string | GetBlobAsString (const string &blob_key)=0 |
Get a blob content as a string. More... | |
virtual CNcbiIstream & | GetIStream (const string &blob_key, size_t *blob_size=NULL, ELockMode lock_mode=eLockWait)=0 |
Get an input stream to a blob. More... | |
virtual CNcbiOstream & | CreateOStream (string &blob_key, ELockMode lock_mode=eLockNoWait)=0 |
Get an output stream to a blob. More... | |
virtual string | CreateEmptyBlob ()=0 |
Create a new empty blob. More... | |
virtual void | DeleteBlob (const string &data_id)=0 |
Delete a blob. More... | |
virtual void | Reset ()=0 |
Reset this object's data. More... | |
virtual void | DeleteStorage (void) |
Delete the storage with all its data. More... | |
Blob Storage interface.
Definition at line 47 of file blob_storage.hpp.
Enumerator | |
---|---|
eLockWait | waits for BLOB to become available |
eLockNoWait | throws an exception immediately if BLOB locked |
Definition at line 50 of file blob_storage.hpp.
|
virtual |
Definition at line 45 of file blob_storage.cpp.
|
pure virtual |
Create a new empty blob.
Implemented in CBlobStorage_Null, and CBlobStorage_NetCache.
|
pure virtual |
Get an output stream to a blob.
blob_key | Blob key to write to. If a blob with a given key does not exist a new blob will be created and its key will be assigned to blob_key |
lock_mode | Blob locking mode |
Implemented in CBlobStorage_NetCache, and CBlobStorage_Null.
Delete a blob.
blob_key | Blob key to delete |
Implemented in CBlobStorage_NetCache, and CBlobStorage_Null.
|
virtual |
Delete the storage with all its data.
Definition at line 48 of file blob_storage.cpp.
References NCBI_THROW.
Get a blob content as a string.
blob_key | Blob key to read from |
Implemented in CBlobStorage_NetCache, and CBlobStorage_Null.
|
pure virtual |
Get an input stream to a blob.
blob_key | Blob key to read from |
blob_size | if blob_size if not NULL the size of a blob is returned |
lock_mode | Blob locking mode |
Implemented in CBlobStorage_NetCache, and CBlobStorage_Null.
Check if a given string is a valid key.
The implementation should not make any connection to the storage, it just checks the str structure.
Implemented in CBlobStorage_NetCache, and CBlobStorage_Null.
|
pure virtual |
Reset this object's data.
Implemented in CBlobStorage_Null, and CBlobStorage_NetCache.