BGC Tools
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Properties | Static Private Attributes
BGC.Study.SessionElement Class Referenceabstract
Collaboration diagram for BGC.Study.SessionElement:
Collaboration graph
[legend]

Public Member Functions

 SessionElement (JsonObject data)
 
 SessionElement ()
 
JsonObject SerializeElement ()
 
abstract void ExecuteElement (bool resuming=false)
 
virtual void CleanupElement ()
 

Static Public Member Functions

static void HardClear ()
 

Data Fields

readonly int id
 
JsonObject envVals
 

Protected Member Functions

abstract void _PopulateJSONObject (JsonObject jsonObject)
 

Properties

abstract string ElementType [get]
 

Static Private Attributes

static int nextElementID = 1
 

Detailed Description

Definition at line 6 of file SessionElement.cs.

Constructor & Destructor Documentation

◆ SessionElement() [1/2]

BGC.Study.SessionElement.SessionElement ( JsonObject  data)
inline

Definition at line 16 of file SessionElement.cs.

References LightJson.JsonObject.ContainsKey(), BGC.Study.ProtocolKeys.SessionElement.EnvironmentValues, and BGC.Study.ProtocolKeys.SessionElement.Id.

17  {
18  id = data[ProtocolKeys.SessionElement.Id];
19  if (nextElementID <= id)
20  {
21  nextElementID = id + 1;
22  }
23 
24  if (data.ContainsKey(ProtocolKeys.SessionElement.EnvironmentValues))
25  {
26  envVals = data[ProtocolKeys.SessionElement.EnvironmentValues].AsJsonObject;
27  }
28  else
29  {
30  envVals = new JsonObject();
31  }
32  }
bool ContainsKey(string key)
Determines whether this collection contains an item assosiated with the given key.
Represents a key-value pair collection of JsonValue objects.
Definition: JsonObject.cs:13
Here is the call graph for this function:

◆ SessionElement() [2/2]

BGC.Study.SessionElement.SessionElement ( )
inline

Definition at line 35 of file SessionElement.cs.

References BGC.Study.ProtocolManager.sessionElementDictionary.

36  {
37  id = nextElementID++;
38 
39  envVals = new JsonObject();
40 
41  ProtocolManager.sessionElementDictionary.Add(id, this);
42  }
Represents a key-value pair collection of JsonValue objects.
Definition: JsonObject.cs:13

Member Function Documentation

◆ _PopulateJSONObject()

abstract void BGC.Study.SessionElement._PopulateJSONObject ( JsonObject  jsonObject)
protectedpure virtual

◆ CleanupElement()

virtual void BGC.Study.SessionElement.CleanupElement ( )
inlinevirtual

Definition at line 65 of file SessionElement.cs.

Referenced by BGC.Study.ProtocolManager.ExecuteNextElement().

65 { }
Here is the caller graph for this function:

◆ ExecuteElement()

abstract void BGC.Study.SessionElement.ExecuteElement ( bool  resuming = false)
pure virtual

Referenced by BGC.Study.ProtocolManager.ExecuteNextElement().

Here is the caller graph for this function:

◆ HardClear()

static void BGC.Study.SessionElement.HardClear ( )
inlinestatic

Definition at line 67 of file SessionElement.cs.

Referenced by BGC.Study.ProtocolManager.HardClearAll().

68  {
69  nextElementID = 1;
70  }
Here is the caller graph for this function:

◆ SerializeElement()

JsonObject BGC.Study.SessionElement.SerializeElement ( )
inline

Definition at line 44 of file SessionElement.cs.

References LightJson.JsonObject.Add(), LightJson.JsonObject.Count, BGC.Study.ProtocolKeys.SessionElement.ElementType, BGC.Study.ProtocolKeys.SessionElement.EnvironmentValues, and BGC.Study.ProtocolKeys.SessionElement.Id.

Referenced by BGC.Study.ProtocolManager.SerializeSessionElements().

45  {
46  JsonObject sessionElement = new JsonObject()
47  {
48  { ProtocolKeys.SessionElement.Id, id },
49  { ProtocolKeys.SessionElement.ElementType, ElementType }
50  };
51 
52  if (envVals.Count > 0)
53  {
54  sessionElement.Add(ProtocolKeys.SessionElement.EnvironmentValues, envVals);
55  }
56 
57  _PopulateJSONObject(sessionElement);
58 
59  return sessionElement;
60  }
abstract string ElementType
int Count
The number of properties in this JsonObject.
Definition: JsonObject.cs:18
Represents a key-value pair collection of JsonValue objects.
Definition: JsonObject.cs:13
abstract void _PopulateJSONObject(JsonObject jsonObject)
JsonObject Add(string key)
Adds a key with a null value to this collection.
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ envVals

JsonObject BGC.Study.SessionElement.envVals

Definition at line 13 of file SessionElement.cs.

Referenced by BGC.Study.ProtocolManager.GetEnvValue().

◆ id

readonly int BGC.Study.SessionElement.id

◆ nextElementID

int BGC.Study.SessionElement.nextElementID = 1
staticprivate

Definition at line 8 of file SessionElement.cs.

Property Documentation

◆ ElementType

abstract string BGC.Study.SessionElement.ElementType
get

Definition at line 10 of file SessionElement.cs.


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