Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OwnerEventNode.cs
1using System;
2using System.Threading.Tasks;
6
8{
12 public abstract class OwnerEventNode : EventNode
13 {
18 : base()
19 {
20 }
21
29 public override async Task<bool> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
30 {
31 if (Arguments.Token is null)
32 throw new Exception("State Machine does not have single token owner.");
33
34 OwnerEventHandler Handler = new OwnerEventHandler(Arguments, EventIndex, this, Arguments.Token.OwnerJid);
35
36 await Database.Insert(Handler);
37 await Handler.AddToCache();
38
39 return false;
40 }
41
42 }
43}
Static interface for database persistence. In order to work, a database provider has to be assigned t...
Definition: Database.cs:19
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Definition: Database.cs:95
async Task AddToCache()
Removes the event handler from the cache.
Contains information required for evaluating script in a state-machine.
Abstract base class for State-Machine event nodes.
Definition: EventNode.cs:10
override async Task< bool > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
OwnerEventNode()
Abstract base class for owner event nodes.
Action executed when entering a state.
Definition: OnEvent.cs:17