Program Listing for File callable-receiver.h

Return to documentation for file (include\playback\callable-receiver.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 <cstdint>
#include <fstream>
#include <mutex>
#include <string>

inline uint64_t BreakAtCallIndex()
{
    static auto sCallIndex = (std::numeric_limits<uint64_t>::max)();
    static std::once_flag sOnceFlag;
    std::call_once(
        sOnceFlag,
        []() {
            std::ifstream callIndexTxt("C:/Development/callIndex.txt");
            if (callIndexTxt.is_open()) {
                std::string line;
                std::getline(callIndexTxt, line);
                if (!line.empty()) {
                    sCallIndex = (uint64_t)atoi(line.c_str());
                }
            }
        });
    return sCallIndex;
}

#define BREAK_AT_CALL_INDEX BreakAtCallIndex()
#define ENABLE_METADATA_DEBUGGING 0

namespace gpa {
namespace playback {

class Callable;
class CallableCache;

class CallableReceiver
{
public:
    virtual ~CallableReceiver() = 0;

public:
    virtual void PostSetupRange(CallableCache* range);
    virtual void PreExecuteRange(CallableCache* range);
    virtual void PreExecuteCall(Callable* callable, uint64_t callIndex);
    virtual void PostExecuteCall(Callable* callable, uint64_t callIndex);
    virtual void PostExecuteRange(CallableCache* range);
};

}  // namespace playback
}  // namespace gpa