TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class SimpleBlockIndex in Tinman.Core.Database

An subclass of BlockIndex for identical key and value types that additionally support comparison.

sealed class SimpleBlockIndex with <T> as IComparable<T>
  extends BlockIndex<T, T>

Public / Attributes

CanRead

Does this object support read access?

public property CanRead { get }
type bool
value true if this object supports reading, false if not.
inherited BlockIndexBase.CanRead

CanWrite

Does this binary object support write access?

public property CanWrite { get }
type bool
value true if this object supports writing, false if not.
inherited BlockIndexBase.CanWrite

IsEmpty

Checks if this block index is empty (i.e. has no entries at all).

[BeginEnd]
public property IsEmpty { get }
type bool
value true if the index is empty, false if there is at least one entry.
inherited BlockIndex.IsEmpty

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

MaximumKey

Returns the maximum entry key in the index.

[BeginEnd]
public property MaximumKey { get }
type TKey
value The maximum entry key.
inherited BlockIndex.MaximumKey

MaximumValue

Returns the maximum entry value in the index.

[BeginEnd]
public property MaximumValue { get }
type TValue
value The maximum entry value.
inherited BlockIndex.MaximumValue

MinimumKey

Returns the minimum entry key in the index.

[BeginEnd]
public property MinimumKey { get }
type TKey
value The minimum entry key.
inherited BlockIndex.MinimumKey

MinimumValue

Returns the minimum entry value in the index.

[BeginEnd]
public property MinimumValue { get }
type TValue
value The minimum entry value.
inherited BlockIndex.MinimumValue

PathInfo

Returns a Path object that represents the file path this object is associated with.

public property PathInfo { get }
type Path
value [not-null] The path info.
inherited BlockIndexBase.PathInfo

Remarks:

Objects that do not have a meaningful file path association simply return Unknown.

Public / Constructors

Create

Creates a new block index in the given block storage.

public static method Create (BlockStorage storage, IBlockIndexFormat<T> format, BlockIdSlot rootLocation)
type SimpleBlockIndex<T>
params storage [not-null] The persistent block storage.
  format [not-null] The index format for mapping keys/values.
  rootLocation The block index root storage location.
returns [not-null] The created BlockIndex object.

Remarks:

The returned block index belongs to storage and will be disposed with it.

New

Creates a new block index in the given block storage.

public static method New (bool create, BlockStorage storage, IBlockIndexFormat<T> format, BlockIdSlot rootLocation)
type SimpleBlockIndex<T>
params create Create a new block index or open an existing one?
  storage [not-null] The persistent block storage.
  format [not-null] The index format for mapping keys/values.
  rootLocation The block index root storage location.
returns [not-null] The created BlockIndex object.

Remarks:

The returned block index belongs to storage and will be disposed with it.

Open

Opens an existing block index in the given block storage.

public static method Open (BlockStorage storage, IBlockIndexFormat<T> format, BlockIdSlot root)
type SimpleBlockIndex<T>
params storage [not-null] The persistent block storage.
  format [not-null] The index format for mapping keys/values.
  root The block index root storage location.
returns [not-null] The created BlockIndex object.

Remarks:

The returned block index belongs to storage and will be disposed with it.

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

Clear

Clears all data from this block index.

[BeginWriteEnd]
public override sealed method Clear ()
inherited BlockIndex.Clear

DeleteKey

Deletes an entry from the block tree.

[BeginWriteEnd]
public method DeleteKey (TKey key)
params key Key of the entry to delete.
inherited BlockIndex.DeleteKey

Remarks:

If no entry exists for the given key, the method silently returns.

DeleteValue

Deletes an entry from the block tree.

[BeginWriteEnd]
public method DeleteValue (TValue value)
params value Value of the entry to delete.
inherited BlockIndex.DeleteValue

Remarks:

If no entry exists for the given key, the method silently returns.

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

Find

Tries to find an entry in the block tree.

[BeginEnd]
public method Find (TKey key, TValue defaultValue = default(TValue))
type TValue
params key Key of the entry to find.
  defaultValue Default value to return if no entry exists for key.
returns The value of the found entry or defaultValue if not found.
inherited BlockIndex.Find

FindAll

Finds all entries.

[BeginEnd]
public method FindAll (CollectorDelegate<TValue> result = null)
type int32
params result Optional collector for found entries. Defaults to null.
returns [>=0] Number of entries.
inherited BlockIndex.FindAll

FindFrom

Finds all entries starting at the given key.

[BeginEnd]
public method FindFrom (TKey from, bool fromIncluded, CollectorDelegate<TValue> result = null)
type int32
params from The first key to find.
  fromIncluded Return from as a result?
  result Optional collector for found entries.
returns [>=0] Number of found entries.
inherited BlockIndex.FindFrom

FindFromTo

Finds all entries that are included in the given key range.

[BeginEnd]
public method FindFromTo (TKey from, bool fromIncluded, TKey to, bool toIncluded, CollectorDelegate<TValue> result = null)
type int32
params from The first key to find.
  fromIncluded Return from as a result?
  to The last key to find.
  toIncluded Return to as a result?
  result Optional collector for found entries.
returns [>=0] Number of found entries.
inherited BlockIndex.FindFromTo

FindMaximum

Tries to find an entry in the block tree.

[BeginEnd]
public method FindMaximum (TKey upper, TValue defaultValue = default(TValue))
type TValue
params upper The upper bound for entry key values (inclusive).
  defaultValue Default value to return if no entry is found.
returns The found entry or defaultValue if not found.
inherited BlockIndex.FindMaximum

Remarks:

All entries that have keys less than or equal to the given upper bound are included in the search. From all included entries, the one with the biggest key value is returned.

FindMinimum

Tries to find an entry in the block tree.

[BeginEnd]
public method FindMinimum (TKey lower, TValue defaultValue = default(TValue))
type TValue
params lower The lower bound for entry key values (inclusive).
  defaultValue Default value to return if no entry is found.
returns The value of the entry or defaultValue if not found.
inherited BlockIndex.FindMinimum

Remarks:

All entries that have keys greater than or equal to the given lower bound are included in the search. From all included entries, the one with the smallest key value is returned.

FindTo

Finds all entries up to the given key.

[BeginEnd]
public method FindTo (TKey to, bool toIncluded, CollectorDelegate<TValue> result = null)
type int32
params to The last key to find.
  toIncluded Return to as a result?
  result Optional collector for found entries.
returns [>=0] Number of found entries.
inherited BlockIndex.FindTo

Insert

Inserts or updates an entry in the block tree.

[BeginWriteEnd]
public method Insert (TValue value)
params value Value of the entry to insert or update.
inherited BlockIndex.Insert

Remarks:

If an entry already exists for the given value, it will be updated. If no entry exists, a new one will be inserted into the index.