Skip to main content

class instruction_graph_generator::delegate

Declaration

class instruction_graph_generator::delegate { /* full declaration omitted */ };

Description

Implement this as the owner of instruction_graph_generator to receive callbacks on generated instructions and pilot messages.

Member Function Overview

Member Functions

virtual void flush(
    std::vector<const instruction*> instructions,
    std::vector<outbound_pilot> pilots)

Description

Called whenever new instructions have been generated and inserted into the instruction graph, and / or new pilot messages have been generated that must be transmitted to peer nodes before they can accept data transmitted through send_instructions originating from the local node. The vector of instructions is in topological order of dependencies, and so is the concatenation of all vectors that are passed through this function. Topological order here means that sequential execution in that order would fulfill all internal dependencies. The instruction graph generator guarantees that instruction pointers are stable and the pointed-to instructions are both immutable and safe to read from other threads. This is exposed as a single function on vectors to minimize lock contention in a threaded delegate implementations.

Parameters

std::vector<const instruction*> instructions
std::vector<outbound_pilot> pilots

delegate()


delegate(const delegate&)

Parameters

const delegate&

delegate(delegate&&)

Parameters

delegate&&

delegate& operator=(const delegate&)

Parameters

const delegate&

delegate& operator=(delegate&&)

Parameters

delegate&&

~delegate()