C# Class kOS.Safe.Execution.ProgramContext

Inheritance: IProgramContext
Afficher le fichier Open project: KSP-KOS/KOS Class Usage Examples

Private Properties

Свойство Type Description
ProtectCSVField string
UpdateFileMap void
UpdateInstructionPointer void
UpdateProgram void

Méthodes publiques

Méthode Description
ActivatePendingTriggers ( ) : void

Take all the pending triggers that have been added by AddPendingTrigger, and finally make them become active. To be called by the CPU when it decides that enough mainline code has had a chance to happen that it's okay to enable triggers again.

ActiveTriggerCount ( ) : int

How many triggers (active) there are.

AddObjectParts ( IEnumerable parts, string objectFileID ) : int
AddParts ( IEnumerable parts ) : void
AddPendingTrigger ( int instructionPointer ) : void

Add a trigger to the list of triggers pending insertion. It will not *finish* inserting it until the CPU tells us it's a good time to do so, by calling ActivatePendingTriggers(). It will also refuse to insert a trigger that's already either active or pending insertion to the active list (avoids duplication).

ClearTriggers ( ) : void

Remove all active and pending triggers.

ContainsTrigger ( int instructionPointer ) : bool

True if the given trigger's IP is for a trigger that is currently active, or is about to become active.

DisableActiveFlyByWire ( IBindingManager manager ) : void
EnableActiveFlyByWire ( IBindingManager manager ) : void
GetAlreadyCompiledEntryPoint ( string fileID ) : int

Return the entry point into the program context where this filename was already inserted into the system before. If it hasn't been inserted before, returns a negative number as a flag indicating this fact. fileID should be a string that will be fully unique for each file (the fully qualified path name, for example).

GetCodeFragment ( int contextLines ) : List
GetCodeFragment ( int start, int stop, bool doProfile = false ) : List
GetTriggerByIndex ( int index ) : int

Return the active trigger at the given index. Cannot be used to get pending insertion triggers.

ProgramContext ( bool interpreterContext ) : System
ProgramContext ( bool interpreterContext, List program ) : System
RemoveTrigger ( int instructionPointer ) : void

Remove a trigger from current triggers or pending insertion triggers or both if need be, so it's not there anymore at all.

ToggleFlyByWire ( string paramName, bool enabled ) : void

Private Methods

Méthode Description
ProtectCSVField ( string s ) : string

Return a version of the string that has been protected for use in a comma-separated file field by quoting and escaping as necessary any special characters inside it.

UpdateFileMap ( string fileID, int entryPoint ) : void
UpdateInstructionPointer ( List oldProgram ) : void
UpdateProgram ( List newProgram ) : void

Method Details

ActivatePendingTriggers() public méthode

Take all the pending triggers that have been added by AddPendingTrigger, and finally make them become active. To be called by the CPU when it decides that enough mainline code has had a chance to happen that it's okay to enable triggers again.
public ActivatePendingTriggers ( ) : void
Résultat void

ActiveTriggerCount() public méthode

How many triggers (active) there are.
public ActiveTriggerCount ( ) : int
Résultat int

AddObjectParts() public méthode

public AddObjectParts ( IEnumerable parts, string objectFileID ) : int
parts IEnumerable
objectFileID string
Résultat int

AddParts() public méthode

public AddParts ( IEnumerable parts ) : void
parts IEnumerable
Résultat void

AddPendingTrigger() public méthode

Add a trigger to the list of triggers pending insertion. It will not *finish* inserting it until the CPU tells us it's a good time to do so, by calling ActivatePendingTriggers(). It will also refuse to insert a trigger that's already either active or pending insertion to the active list (avoids duplication).
public AddPendingTrigger ( int instructionPointer ) : void
instructionPointer int
Résultat void

ClearTriggers() public méthode

Remove all active and pending triggers.
public ClearTriggers ( ) : void
Résultat void

ContainsTrigger() public méthode

True if the given trigger's IP is for a trigger that is currently active, or is about to become active.
public ContainsTrigger ( int instructionPointer ) : bool
instructionPointer int
Résultat bool

DisableActiveFlyByWire() public méthode

public DisableActiveFlyByWire ( IBindingManager manager ) : void
manager IBindingManager
Résultat void

EnableActiveFlyByWire() public méthode

public EnableActiveFlyByWire ( IBindingManager manager ) : void
manager IBindingManager
Résultat void

GetAlreadyCompiledEntryPoint() public méthode

Return the entry point into the program context where this filename was already inserted into the system before. If it hasn't been inserted before, returns a negative number as a flag indicating this fact. fileID should be a string that will be fully unique for each file (the fully qualified path name, for example).
public GetAlreadyCompiledEntryPoint ( string fileID ) : int
fileID string
Résultat int

GetCodeFragment() public méthode

public GetCodeFragment ( int contextLines ) : List
contextLines int
Résultat List

GetCodeFragment() public méthode

public GetCodeFragment ( int start, int stop, bool doProfile = false ) : List
start int
stop int
doProfile bool
Résultat List

GetTriggerByIndex() public méthode

Return the active trigger at the given index. Cannot be used to get pending insertion triggers.
public GetTriggerByIndex ( int index ) : int
index int
Résultat int

ProgramContext() public méthode

public ProgramContext ( bool interpreterContext ) : System
interpreterContext bool
Résultat System

ProgramContext() public méthode

public ProgramContext ( bool interpreterContext, List program ) : System
interpreterContext bool
program List
Résultat System

RemoveTrigger() public méthode

Remove a trigger from current triggers or pending insertion triggers or both if need be, so it's not there anymore at all.
public RemoveTrigger ( int instructionPointer ) : void
instructionPointer int
Résultat void

ToggleFlyByWire() public méthode

public ToggleFlyByWire ( string paramName, bool enabled ) : void
paramName string
enabled bool
Résultat void