DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Deveel.Data.Index.SnapshotIndexSet Class Reference
Inheritance diagram for Deveel.Data.Index.SnapshotIndexSet:
Deveel.Data.Index.IIndexSet

Public Member Functions

 SnapshotIndexSet (IndexSetStore indexSetStore, IndexBlock[] blocks)
 
void Dispose ()
 
IIndex GetIndex (int offset)
 Gets a mutable implementation of IIndex for the given index number in this set of indices. More...
 

Properties

IEnumerable< StoreIndexAllIndices [get]
 
IndexBlock[] IndexBlocks [get, private set]
 

Private Member Functions

 ~SnapshotIndexSet ()
 
void Dispose (bool disposing)
 

Private Attributes

readonly IndexSetStore indexSetStore
 
List< StoreIndexindexes
 
bool disposed
 

Static Private Attributes

static readonly StoreIndex[] EmptyIndex = new StoreIndex[0]
 

Detailed Description

Definition at line 22 of file SnapshotIndexSet.cs.

Constructor & Destructor Documentation

Deveel.Data.Index.SnapshotIndexSet.SnapshotIndexSet ( IndexSetStore  indexSetStore,
IndexBlock[]  blocks 
)
inline

Definition at line 30 of file SnapshotIndexSet.cs.

30  {
32  IndexBlocks = blocks;
33 
34  // Not disposed.
35  disposed = false;
36 
37  }
readonly IndexSetStore indexSetStore
Deveel.Data.Index.SnapshotIndexSet.~SnapshotIndexSet ( )
inlineprivate

Definition at line 39 of file SnapshotIndexSet.cs.

39  {
40  Dispose(false);
41  }

Member Function Documentation

void Deveel.Data.Index.SnapshotIndexSet.Dispose ( )
inline

Definition at line 54 of file SnapshotIndexSet.cs.

54  {
55  Dispose(true);
56  GC.SuppressFinalize(this);
57  }
void Deveel.Data.Index.SnapshotIndexSet.Dispose ( bool  disposing)
inlineprivate

Definition at line 59 of file SnapshotIndexSet.cs.

59  {
60  if (!disposed) {
61  if (disposing) {
62  try {
63  if (indexes != null) {
64  foreach (var index in indexes) {
65  index.Dispose();
66  }
67  }
68 
69  // Release reference to the index_blocks;
70  foreach (var block in IndexBlocks) {
71  block.RemoveReference();
72  }
73  } catch (Exception) {
74  }
75  }
76 
77  indexes = null;
78  IndexBlocks = null;
79  disposed = true;
80  }
81  }
IIndex Deveel.Data.Index.SnapshotIndexSet.GetIndex ( int  index)
inline

Gets a mutable implementation of IIndex for the given index number in this set of indices.

Parameters
index
Returns

Implements Deveel.Data.Index.IIndexSet.

Definition at line 84 of file SnapshotIndexSet.cs.

84  {
85  // Create if not exist.
86  if (indexes == null) {
87  indexes = new List<StoreIndex>();
88  } else {
89  // If this list has already been created, return it
90  foreach (var index in indexes) {
91  if (index.IndexNumber == offset)
92  return index;
93  }
94  }
95 
96  try {
97  var index = (StoreIndex) IndexBlocks[offset].CreateIndex();
98  indexes.Add(index);
99  return index;
100  } catch (IOException e) {
101  throw new Exception("IO Error: " + e.Message, e);
102  }
103  }

Member Data Documentation

bool Deveel.Data.Index.SnapshotIndexSet.disposed
private

Definition at line 26 of file SnapshotIndexSet.cs.

readonly StoreIndex [] Deveel.Data.Index.SnapshotIndexSet.EmptyIndex = new StoreIndex[0]
staticprivate

Definition at line 28 of file SnapshotIndexSet.cs.

List<StoreIndex> Deveel.Data.Index.SnapshotIndexSet.indexes
private

Definition at line 24 of file SnapshotIndexSet.cs.

readonly IndexSetStore Deveel.Data.Index.SnapshotIndexSet.indexSetStore
private

Definition at line 23 of file SnapshotIndexSet.cs.

Property Documentation

IEnumerable<StoreIndex> Deveel.Data.Index.SnapshotIndexSet.AllIndices
get

Definition at line 43 of file SnapshotIndexSet.cs.

IndexBlock [] Deveel.Data.Index.SnapshotIndexSet.IndexBlocks
getprivate set

Definition at line 52 of file SnapshotIndexSet.cs.


The documentation for this class was generated from the following file: