Program Listing for File callable-broadcaster.h

Return to documentation for file (include\playback\callable-broadcaster.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include <functional>
#include <vector>

namespace gpa {
namespace playback {

class Callable;
class CallableCache;

using QueuesRequiringGpuSynchronization = std::vector<void*>;

struct ExecutionCallbacks final
{
    // This will be called after the initial repeat cycle setup stage, before execution of the callable range.
    std::function<void(CallableCache* range)> PostSetupRange;
    // This will be called before the Range is executed in the player.
    std::function<void(CallableCache* range)> PreExecuteRange;
    // This will be called before the Callable is executed in the player.
    std::function<void(Callable* callable, uint64_t callIndex)> PreExecuteCall;
    // This will be called after the Callable is executed in the player.
    std::function<void(Callable* callable, uint64_t callIndex)> PostExecuteCall;
    // This will be called after range execute, to determine which queues should be synchronized.
    std::function<void(QueuesRequiringGpuSynchronization& queuesToSynchronize)> BeforePostExecuteRange;
    // This will be called after the Range is executed in the player.
    std::function<void(CallableCache* range)> PostExecuteRange;
    // This will be called to determine if the Callable scheduled for execution should be executed.
    std::function<bool(Callable* callable, uint64_t callIndex)> ExecuteCallCondition;
};

class CallableCallbacks
{
public:
    virtual ~CallableCallbacks();

public:
    virtual void BeforePostExecuteRange(QueuesRequiringGpuSynchronization& queuesToSynchronize);
};

class CallableBroadcaster
{
public:
    virtual ~CallableBroadcaster();

public:
    virtual void ConnectExecutionCallbacks(ExecutionCallbacks const& callbacks) = 0;
    virtual void DisconnectExecutionCallbacks() = 0;
};

}  // namespace playback
}  // namespace gpa