import { FunctionType, VoidType, CompleteObjectType, ReferenceType, AtomicType, CompleteClassType, CompleteReturnType, ReferredType } from "./types"; import { RuntimeConstruct } from "../constructs/CPPConstruct"; import { CompiledFunctionDefinition } from "../constructs/declarations/function/FunctionDefinition"; import { MemoryFrame } from "../runtime/Memory"; import { CPPObject } from "../runtime/objects"; import { RuntimeBlock } from "../constructs/statements/Block"; import { Simulation } from "../runtime/Simulation"; import { RuntimeCtorInitializer } from "../constructs/initializers/CtorInitializer"; import { RuntimeFunctionCall } from "../constructs/FunctionCall"; import { RuntimeObjectDeallocator } from "../constructs/ObjectDeallocator"; export declare class RuntimeFunction = FunctionType> extends RuntimeConstruct> { readonly caller?: RuntimeFunctionCall; readonly stackFrame?: MemoryFrame; readonly receiver?: CPPObject; /** * The object returned by the function, either an original returned-by-reference or a temporary * object created to hold a return-by-value. Once the function call has been executed, will be * defined unless it's a void function. */ readonly returnObject?: T extends FunctionType ? (RT extends VoidType ? undefined : RT extends CompleteObjectType ? CPPObject : RT extends ReferenceType ? CPPObject> : never) : never; readonly hasControl: boolean; readonly ctorInitializer?: RuntimeCtorInitializer; readonly body: RuntimeBlock; /** * Only defined for destructors. A runtime deallocator for the member * variables of the receiver that is set as the cleanup construct for * this RuntimeFunction. */ readonly memberDeallocator?: RuntimeObjectDeallocator; constructor(model: CompiledFunctionDefinition, sim: Simulation, caller: RuntimeFunctionCall | null, receiver?: CPPObject); pushStackFrame(): void; popStackFrame(): void; /** * Sets the return object for this function. May only be invoked once. * e.g. * - return-by-value: The caller should set the return object to a temporary object, whose value * may be initialized by a return statement. * - return-by-reference: When the function is finished, is set to the object returned. */ setReturnObject>(this: RuntimeFunction, obj: CPPObject): void; setReturnObject>(this: RuntimeFunction>, obj: CPPObject>): void; getParameterObject(num: number): import("../runtime/objects").AutoObject; bindReferenceParameter(num: number, obj: CPPObject): void; gainControl(): void; loseControl(): void; protected stepForwardImpl(): void; protected upNextImpl(): void; }