formatter
DbEntry key = DbEntry
dataStream
formatter
DbEntry data = DbEntry
WriteStatus status = btree
switch (status)
{
case WriteStatus
return true;
case WriteStatus
case WriteStatus
default:
return false;
}
}
private bool iscomit = false;
public void Commit()
{
txn
iscomit = true;
}
public List<IPut> Find()
{
List<IPut> custList = new List<IPut>();
using (DbBTreeCursor cursor = btree
{
IPut cust = null;
while (GetNextRecord(cursor
custList
}
return custList;
}
public bool Get(ref IPut put)
{
keyStream
formatter
DbEntry key = DbEntry
dataStream
DbEntry data = DbEntry
while (true)
{
ReadStatus status = btree
switch (status)
{
case ReadStatus
dataStream
dataStream
put = (IPut)formatter
return true;
case ReadStatus
if (key
{
keyStream
key = DbEntry
}
if (data
{
dataStream
data = DbEntry
}
continue;
case ReadStatus
case ReadStatus
default:
return false;
}
}
}
[
From:http://tw.wingwit.com/Article/program/net/201311/14801.html