コード例 #1
0
ファイル: Automata.Process.Thread.cs プロジェクト: Egaros/lib
 public Thread(Node node, InstructionStream instructionStream, AutomataContextState contextState) : this()
 {
     CurrentNode        = node;
     InstructionPointer = InstructionStream.InitializeInstructionPointer();
     InstructionStream  = instructionStream.AddReference();
     ContextState       = contextState;
 }
コード例 #2
0
ファイル: Automata.AutomataStack.cs プロジェクト: Egaros/lib
            public AutomataExecutionContext Mount(InstructionStream instructionStream, int instructionPointer, Node node, AutomataStack stack)
            {
                InstructionStream  = instructionStream.AddReference();
                InstructionPointer = instructionPointer;
                Node  = node;
                Stack = stack.AddReference();

                return(AddReference());
            }
コード例 #3
0
ファイル: Automata.AutomataStack.cs プロジェクト: Egaros/lib
            public AutomataExecutionContext Clone()
            {
                var clone = Pool.Get().AddReference();

                clone.Stack              = Stack.Clone();
                clone.InstructionStream  = InstructionStream.AddReference();
                clone.InstructionPointer = InstructionPointer;
                clone.Node = Node;

                return(clone);
            }
コード例 #4
0
ファイル: Automata.Process.Thread.cs プロジェクト: Egaros/lib
                public Thread(ThreadParent parent, Node node, InstructionStream instructionStream, int instructionPointer, AutomataContextState contextState) : this()
                {
                    CurrentNode        = node;
                    InstructionPointer = instructionPointer;
                    ContextState       = contextState;
                    InstructionStream  = instructionStream.AddReference();

                    InstructionStream.LockPointer(InstructionPointer);

                    if (parent == null)
                    {
                        return;
                    }

                    Parent = parent;
                    Parent.AddReference();
                }