// // Copyright (c) ZeroC, Inc. All rights reserved. // #ifndef CALLBACK_I_H #define CALLBACK_I_H #include #include class CallbackReceiverI final : public Test::CallbackReceiver { public: void callback(const Ice::Current&) override; void callbackEx(const Ice::Current&) override; void concurrentCallbackAsync(int, std::function, std::function, const ::Ice::Current&) override; void waitCallback(const ::Ice::Current&) override; void callbackWithPayload(Ice::ByteSeq, const ::Ice::Current&) override; void callbackOK(int = 1); void waitCallbackOK(); void callbackWithPayloadOK(); void notifyWaitCallback(); void answerConcurrentCallbacks(unsigned int); private: int _callback = 0; bool _waitCallback = false; bool _callbackWithPayload = false; bool _finishWaitCallback = false; std::vector, std::function, int>> _callbacks; std::mutex _mutex; std::condition_variable _condVar; }; class CallbackI final : public ::Test::Callback { public: void initiateCallbackAsync(std::shared_ptr, std::function, std::function, const Ice::Current&) override; void initiateCallbackExAsync(std::shared_ptr, std::function, std::function, const Ice::Current&) override; void initiateConcurrentCallbackAsync(int, std::shared_ptr, std::function, std::function, const Ice::Current&) override; void initiateWaitCallbackAsync(std::shared_ptr, std::function, std::function, const Ice::Current&) override; void initiateCallbackWithPayloadAsync(std::shared_ptr, std::function, std::function, const Ice::Current&) override; void shutdown(const Ice::Current&) override; }; #endif