DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
Deveel.Data.Sql.Query.CachePointNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Query.CachePointNode:
Deveel.Data.Sql.Query.SingleQueryPlanNode Deveel.Data.Sql.Query.IQueryPlanNode Deveel.Data.Serialization.ISerializable

Public Member Functions

 CachePointNode (IQueryPlanNode child)
 
 CachePointNode (IQueryPlanNode child, long id)
 
override ITable Evaluate (IRequest context)
 

Protected Member Functions

override void GetData (SerializeData data)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Query.SingleQueryPlanNode
 SingleQueryPlanNode (IQueryPlanNode child)
 
 SingleQueryPlanNode (ObjectData data)
 

Properties

long Id [get, private set]
 
- Properties inherited from Deveel.Data.Sql.Query.SingleQueryPlanNode
IQueryPlanNode Child [get, private set]
 Gets the single child node of the plan. More...
 

Private Member Functions

 CachePointNode (ObjectData data)
 

Static Private Member Functions

static long NewId ()
 

Static Private Attributes

static readonly Object GlobLock = new Object()
 
static int GlobId
 

Detailed Description

Definition at line 25 of file CachePointNode.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Query.CachePointNode.CachePointNode ( IQueryPlanNode  child)
inline

Definition at line 29 of file CachePointNode.cs.

30  : this(child,NewId()) {
31  }
Deveel.Data.Sql.Query.CachePointNode.CachePointNode ( IQueryPlanNode  child,
long  id 
)
inline

Definition at line 33 of file CachePointNode.cs.

34  : base(child) {
35  Id = id;
36  }
Deveel.Data.Sql.Query.CachePointNode.CachePointNode ( ObjectData  data)
inlineprivate

Definition at line 38 of file CachePointNode.cs.

39  : base(data) {
40  Id = data.GetInt32("Id");
41  }

Member Function Documentation

override ITable Deveel.Data.Sql.Query.CachePointNode.Evaluate ( IRequest  context)
inlinevirtual

Implements Deveel.Data.Sql.Query.SingleQueryPlanNode.

Definition at line 54 of file CachePointNode.cs.

54  {
55  // Is the result available in the context?
56  var childTable = context.Query.GetCachedTable(Id.ToString());
57  if (childTable == null) {
58  // No so evaluate the child and cache it
59  childTable = Child.Evaluate(context);
60  context.Query.CacheTable(Id.ToString(), childTable);
61  }
62 
63  return childTable;
64  }
ITable Evaluate(IRequest context)
IQueryPlanNode Child
Gets the single child node of the plan.
override void Deveel.Data.Sql.Query.CachePointNode.GetData ( SerializeData  data)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Query.SingleQueryPlanNode.

Definition at line 66 of file CachePointNode.cs.

66  {
67  data.SetValue("Id", Id);
68  }
void SetValue(string key, Type type, object value)
static long Deveel.Data.Sql.Query.CachePointNode.NewId ( )
inlinestaticprivate

Definition at line 43 of file CachePointNode.cs.

43  {
44  long id;
45  lock (GlobLock) {
46  id = ((int)DateTime.Now.Ticks << 16) | (GlobId & 0x0FFFF);
47  ++GlobId;
48  }
49  return id;
50  }

Member Data Documentation

int Deveel.Data.Sql.Query.CachePointNode.GlobId
staticprivate

Definition at line 27 of file CachePointNode.cs.

readonly Object Deveel.Data.Sql.Query.CachePointNode.GlobLock = new Object()
staticprivate

Definition at line 26 of file CachePointNode.cs.

Property Documentation

long Deveel.Data.Sql.Query.CachePointNode.Id
getprivate set

Definition at line 52 of file CachePointNode.cs.


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