DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.Variables.VariableManager Class Reference
Inheritance diagram for Deveel.Data.Sql.Variables.VariableManager:
Deveel.Data.Sql.Variables.IVariableManager Deveel.Data.Sql.IVariableResolver

Public Member Functions

 VariableManager (IVariableScope scope)
 
void Dispose ()
 
Variable DefineVariable (VariableInfo variableInfo)
 
bool VariableExists (string name)
 
Variable GetVariable (string name)
 
bool DropVariable (string name)
 

Properties

IVariableScope Scope [get, private set]
 

Private Member Functions

void Dispose (bool disposing)
 
DataObject IVariableResolver. Resolve (ObjectName variableName)
 Returns the value of a given variable. More...
 
SqlType IVariableResolver. ReturnType (ObjectName variableName)
 Returns the SqlType of object the given variable is. More...
 

Private Attributes

Dictionary< string, Variablevariables
 

Detailed Description

Definition at line 23 of file VariableManager.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Variables.VariableManager.VariableManager ( IVariableScope  scope)
inline

Definition at line 26 of file VariableManager.cs.

26  {
27  Scope = scope;
28 
29  variables = new Dictionary<string, Variable>();
30  }
Dictionary< string, Variable > variables

Member Function Documentation

Variable Deveel.Data.Sql.Variables.VariableManager.DefineVariable ( VariableInfo  variableInfo)
inline

Implements Deveel.Data.Sql.Variables.IVariableManager.

Definition at line 48 of file VariableManager.cs.

48  {
49  if (variableInfo == null)
50  throw new ArgumentNullException("variableInfo");
51 
52  if (variables.ContainsKey(variableInfo.VariableName))
53  throw new ArgumentException();
54 
55  var variable = new Variable(variableInfo);
56  variables[variableInfo.VariableName] = variable;
57  return variable;
58  }
A single variable within a query context or in the system global context.
Dictionary< string, Variable > variables
void Deveel.Data.Sql.Variables.VariableManager.Dispose ( )
inline

Definition at line 34 of file VariableManager.cs.

34  {
35  Dispose(true);
36  GC.SuppressFinalize(this);
37  }
void Deveel.Data.Sql.Variables.VariableManager.Dispose ( bool  disposing)
inlineprivate

Definition at line 39 of file VariableManager.cs.

39  {
40  if (disposing) {
41  if (variables != null)
42  variables.Clear();
43  }
44 
45  variables = null;
46  }
Dictionary< string, Variable > variables
bool Deveel.Data.Sql.Variables.VariableManager.DropVariable ( string  name)
inline

Implements Deveel.Data.Sql.Variables.IVariableManager.

Definition at line 72 of file VariableManager.cs.

72  {
73  return variables.Remove(name);
74  }
Dictionary< string, Variable > variables
Variable Deveel.Data.Sql.Variables.VariableManager.GetVariable ( string  name)
inline

Implements Deveel.Data.Sql.Variables.IVariableManager.

Definition at line 64 of file VariableManager.cs.

64  {
65  Variable variable;
66  if (!variables.TryGetValue(name, out variable))
67  return null;
68 
69  return variable;
70  }
A single variable within a query context or in the system global context.
Dictionary< string, Variable > variables
DataObject IVariableResolver. Deveel.Data.Sql.Variables.VariableManager.Resolve ( ObjectName  variable)
inlineprivate

Returns the value of a given variable.

Parameters
variable
Returns

Implements Deveel.Data.Sql.IVariableResolver.

Definition at line 76 of file VariableManager.cs.

76  {
77  Variable variable;
78  if (!variables.TryGetValue(variableName.Name, out variable))
79  return null;
80 
81  return variable.Value;
82  }
A single variable within a query context or in the system global context.
Dictionary< string, Variable > variables
SqlType IVariableResolver. Deveel.Data.Sql.Variables.VariableManager.ReturnType ( ObjectName  variable)
inlineprivate

Returns the SqlType of object the given variable is.

Parameters
variable
Returns

Implements Deveel.Data.Sql.IVariableResolver.

Definition at line 84 of file VariableManager.cs.

84  {
85  Variable variable;
86  if (!variables.TryGetValue(variableName.Name, out variable))
87  return null;
88 
89  return variable.Type;
90  }
A single variable within a query context or in the system global context.
Dictionary< string, Variable > variables
bool Deveel.Data.Sql.Variables.VariableManager.VariableExists ( string  name)
inline

Implements Deveel.Data.Sql.Variables.IVariableManager.

Definition at line 60 of file VariableManager.cs.

60  {
61  return variables.ContainsKey(name);
62  }
Dictionary< string, Variable > variables

Member Data Documentation

Dictionary<string, Variable> Deveel.Data.Sql.Variables.VariableManager.variables
private

Definition at line 24 of file VariableManager.cs.

Property Documentation

IVariableScope Deveel.Data.Sql.Variables.VariableManager.Scope
getprivate set

Definition at line 32 of file VariableManager.cs.


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