// --------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // --------------------------------------------------------------------------- // --------------------------------------------------------------------- // // // --------------------------------------------------------------------- namespace Microsoft.Database.Isam { using System; using Microsoft.Isam.Esent.Interop; /// /// A wrapper class around Temp Tables. /// internal class TempTableHandle { /// /// The unique identifier /// private readonly Guid guid; /// /// The name /// private readonly string name = null; /// /// The sesid /// private readonly JET_SESID sesid; /// /// The tableid /// private readonly JET_TABLEID tableid; /// /// The in insert mode /// private bool inInsertMode = false; /// /// The cursor count /// private int cursorCount = 0; /// /// Initializes a new instance of the class. /// internal TempTableHandle() { } /// /// Initializes a new instance of the class. /// /// The name. /// The sesid. /// The tableid. /// if set to true [in insert mode]. internal TempTableHandle(string name, JET_SESID sesid, JET_TABLEID tableid, bool inInsertMode) { this.guid = Guid.NewGuid(); this.name = name; this.sesid = sesid; this.tableid = tableid; this.inInsertMode = inInsertMode; this.cursorCount = 0; } /// /// Gets the name of the table. /// public string Name { get { return this.name; } } /// /// Gets the used to open and access the table. /// public JET_SESID Sesid { get { return this.sesid; } } /// /// Gets the handle of the table. /// public JET_TABLEID Handle { get { return this.tableid; } } /// /// Gets or sets a value indicating whether the table handle is in insert mode. /// public bool InInsertMode { get { return this.inInsertMode; } set { this.inInsertMode = value; } } /// /// Gets or sets the count of cursors open on this table. /// public int CursorCount { get { return this.cursorCount; } set { this.cursorCount = value; } } /// /// Gets the GUID of the table. /// internal Guid Guid { get { return this.guid; } } } }