BGC Tools
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Static Private Attributes
BGC.Study.Protocol Class Reference
Inheritance diagram for BGC.Study.Protocol:
Inheritance graph
[legend]
Collaboration diagram for BGC.Study.Protocol:
Collaboration graph
[legend]

Public Member Functions

 Protocol ()
 
 Protocol (string name)
 
 Protocol (int id)
 
void Add (Session session)
 
void AddRange (IEnumerable< Session > sessions)
 

Static Public Member Functions

static void HardClear ()
 

Data Fields

readonly int id
 
string name
 
List< SessionIDsessions
 
JsonObject envVals
 
int Count => sessions.Count
 
Session this[int i] => sessions[i].Session
 

Private Member Functions

IEnumerator< SessionID > IEnumerable< SessionID >. GetEnumerator ()
 
IEnumerator IEnumerable. GetEnumerator ()
 

Static Private Attributes

static int nextProtocolID = 1
 

Detailed Description

Definition at line 9 of file Protocol.cs.

Constructor & Destructor Documentation

◆ Protocol() [1/3]

BGC.Study.Protocol.Protocol ( )
inline

Definition at line 19 of file Protocol.cs.

References BGC.Study.ProtocolManager.protocolDictionary.

20  {
21  id = nextProtocolID++;
22  sessions = new List<SessionID>();
23  envVals = new JsonObject();
24 
25  ProtocolManager.protocolDictionary.Add(id, this);
26  }
List< SessionID > sessions
Definition: Protocol.cs:15
static int nextProtocolID
Definition: Protocol.cs:11
JsonObject envVals
Definition: Protocol.cs:16
Represents a key-value pair collection of JsonValue objects.
Definition: JsonObject.cs:13

◆ Protocol() [2/3]

BGC.Study.Protocol.Protocol ( string  name)
inline

Definition at line 29 of file Protocol.cs.

30  : this()
31  {
32  this.name = name;
33  }

◆ Protocol() [3/3]

BGC.Study.Protocol.Protocol ( int  id)
inline

Definition at line 36 of file Protocol.cs.

37  {
38  this.id = id;
39  if (nextProtocolID <= id)
40  {
41  nextProtocolID = id + 1;
42  }
43 
44  //Should be assigned by constructing caller
45  envVals = null;
46  }
static int nextProtocolID
Definition: Protocol.cs:11
JsonObject envVals
Definition: Protocol.cs:16
readonly int id
Definition: Protocol.cs:12

Member Function Documentation

◆ Add()

void BGC.Study.Protocol.Add ( Session  session)

◆ AddRange()

void BGC.Study.Protocol.AddRange ( IEnumerable< Session sessions)
inline

Definition at line 54 of file Protocol.cs.

55  {
56  foreach (Session session in sessions)
57  {
58  this.sessions.Add(session);
59  }
60  }

◆ GetEnumerator() [1/2]

IEnumerator<SessionID> IEnumerable<SessionID>. BGC.Study.Protocol.GetEnumerator ( )
private

◆ GetEnumerator() [2/2]

IEnumerator IEnumerable. BGC.Study.Protocol.GetEnumerator ( )
private

◆ HardClear()

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

Definition at line 62 of file Protocol.cs.

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

63  {
64  nextProtocolID = 1;
65  }
static int nextProtocolID
Definition: Protocol.cs:11
Here is the caller graph for this function:

Field Documentation

◆ Count

int BGC.Study.Protocol.Count => sessions.Count

Definition at line 48 of file Protocol.cs.

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

◆ envVals

JsonObject BGC.Study.Protocol.envVals

◆ id

readonly int BGC.Study.Protocol.id

◆ name

string BGC.Study.Protocol.name

Definition at line 14 of file Protocol.cs.

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

◆ nextProtocolID

int BGC.Study.Protocol.nextProtocolID = 1
staticprivate

Definition at line 11 of file Protocol.cs.

◆ sessions

List<SessionID> BGC.Study.Protocol.sessions

Definition at line 15 of file Protocol.cs.

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

◆ this[int i]

Session BGC.Study.Protocol.this[int i] => sessions[i].Session

Definition at line 50 of file Protocol.cs.


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