IOdbBackend Interface
Namespace: Stride.Core.StorageAssembly: Stride.Core.Serialization.dll
Base class for custom object database backends (ODB).
public interface IOdbBackend : IDisposable
| Name | Description | |
|---|---|---|
| Properties | ||
| ContentIndexMap | Gets the asset index map. |
|
| Methods | ||
| CreateStream() | Creates a stream that will be saved to database when closed and/or disposed. |
|
| Delete(ObjectId) | Deletes the specified ObjectId. |
|
| EnumerateObjects() | Enumerates the object stored in this backend. |
|
| Exists(ObjectId) | Determines weither the object with the specified ObjectId exists. |
|
| GetFilePath(ObjectId) | Returns the file path corresponding to the given id (in the VFS domain), if appliable. |
|
| GetSize(ObjectId) | Requests that this backend read an object's length (but not its contents). |
|
| OpenStream(ObjectId, VirtualFileMode, VirtualFileAccess, VirtualFileShare) | Opens a NativeStream of the object with the specified ObjectId. |
|
| Write(ObjectId, Stream, Int32, Boolean) | Writes an object to the backing store. The backend may need to compute the object ID and return it to the caller. |
|
Properties
ContentIndexMap
Gets the asset index map.
IContentIndexMap ContentIndexMap { get; }
Property Value
| Type | Description |
|---|---|
| IContentIndexMap | The asset index map. |
Methods
CreateStream()
Creates a stream that will be saved to database when closed and/or disposed.
OdbStreamWriter CreateStream()
Returns
| Type | Description |
|---|---|
| OdbStreamWriter | a stream writer that should be passed to |
Delete(ObjectId)
Deletes the specified ObjectId.
void Delete(ObjectId objectId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectId | objectId | The object id. |
EnumerateObjects()
Enumerates the object stored in this backend.
IEnumerable<ObjectId> EnumerateObjects()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ObjectId> |
Exists(ObjectId)
Determines weither the object with the specified ObjectId exists.
bool Exists(ObjectId objectId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectId | objectId | The ObjectId to check existence for. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
GetFilePath(ObjectId)
Returns the file path corresponding to the given id (in the VFS domain), if appliable.
string GetFilePath(ObjectId objectId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectId | objectId | The ObjectId. |
Returns
| Type | Description |
|---|---|
| System.String | The file path. |
GetSize(ObjectId)
Requests that this backend read an object's length (but not its contents).
int GetSize(ObjectId objectId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectId | objectId | The ObjectId. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The object size. |
OpenStream(ObjectId, VirtualFileMode, VirtualFileAccess, VirtualFileShare)
Opens a NativeStream of the object with the specified ObjectId.
Stream OpenStream(ObjectId objectId, VirtualFileMode mode = VirtualFileMode.Open, VirtualFileAccess access = VirtualFileAccess.Read, VirtualFileShare share = VirtualFileShare.Read)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectId | objectId | The ObjectId. |
| VirtualFileMode | mode | The mode. |
| VirtualFileAccess | access | The access. |
| VirtualFileShare | share | The process share mode. |
Returns
| Type | Description |
|---|---|
| System.IO.Stream | A NativeStream opened from the specified ObjectId. |
Write(ObjectId, Stream, Int32, Boolean)
Writes an object to the backing store. The backend may need to compute the object ID and return it to the caller.
ObjectId Write(ObjectId objectId, Stream dataStream, int length, bool forceWrite = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectId | objectId | The ObjectId if already computed, or Empty if not determined yet. |
| System.IO.Stream | dataStream | The data stream. |
| System.Int32 | length | The data length. |
| System.Boolean | forceWrite | Set to true to force writing the datastream even if a content is already stored with the same id. Default is false. |
Returns
| Type | Description |
|---|---|
| ObjectId | The generated ObjectId. |