C# Class AcTools.LapTimes.LevelDbUtils.WriteBatch

WriteBatch holds a collection of updates to apply atomically to a DB. The updates are applied in the order in which they are added to the WriteBatch. For example, the value of "key" will be "v3" after the following batch is written: batch.Put("key", "v1"); batch.Delete("key"); batch.Put("key", "v2"); batch.Put("key", "v3");
Inheritance: LevelDbHandle
Show file Open project: gro-ove/actools

Public Methods

Method Description
Clear ( ) : void

Clear all updates buffered in this batch.

Delete ( byte key ) : WriteBatch

If the database contains a mapping for "key", erase it. Else do nothing.

Delete ( string key ) : WriteBatch

If the database contains a mapping for "key", erase it. Else do nothing.

Iterate ( object state, Action put, Action deleted ) : void

Support for iterating over a batch.

Put ( byte key, byte value ) : WriteBatch

Store the mapping "key->value" in the database.

Put ( string key, string value ) : WriteBatch

Store the mapping "key->value" in the database.

WriteBatch ( ) : System

Protected Methods

Method Description
FreeUnManagedObjects ( ) : void

Method Details

Clear() public method

Clear all updates buffered in this batch.
public Clear ( ) : void
return void

Delete() public method

If the database contains a mapping for "key", erase it. Else do nothing.
public Delete ( byte key ) : WriteBatch
key byte
return WriteBatch

Delete() public method

If the database contains a mapping for "key", erase it. Else do nothing.
public Delete ( string key ) : WriteBatch
key string
return WriteBatch

FreeUnManagedObjects() protected method

protected FreeUnManagedObjects ( ) : void
return void

Iterate() public method

Support for iterating over a batch.
public Iterate ( object state, Action put, Action deleted ) : void
state object
put Action
deleted Action
return void

Put() public method

Store the mapping "key->value" in the database.
public Put ( byte key, byte value ) : WriteBatch
key byte
value byte
return WriteBatch

Put() public method

Store the mapping "key->value" in the database.
public Put ( string key, string value ) : WriteBatch
key string
value string
return WriteBatch

WriteBatch() public method

public WriteBatch ( ) : System
return System