#ifndef CALLBACK_H #define CALLBACK_H #include #include namespace smo { // Forward declaration class AsyncContinuation; /** * @brief Callback class that wraps a function and its caller continuation * * This class provides a way to pass both a callback function and the * caller's continuation in a single object, enabling deadlock detection * by walking the chain of continuations. */ template class Callback { public: /** * @brief Constructor * @param caller The caller's continuation * @param cb The callback function to invoke */ Callback(std::shared_ptr caller, std::function cb) : callerContinuation(std::move(caller)), callback(std::move(cb)) {} public: std::shared_ptr callerContinuation; std::function callback; }; } // namespace smo #endif // CALLBACK_H