MCPcopy Create free account
hub / github.com/chronoxor/CppServer / AsioTimer

Class AsioTimer

examples/asio_timer.cpp:16–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include <iostream>
15
16class AsioTimer : public CppServer::Asio::Timer
17{
18public:
19 using CppServer::Asio::Timer::Timer;
20
21protected:
22 void onTimer(bool canceled) override
23 {
24 std::cout << "Asio timer " << (canceled ? "canceled" : "expired") << std::endl;
25 }
26
27 void onError(int error, const std::string& category, const std::string& message) override
28 {
29 std::cout << "Asio timer caught an error with code " << error << " and category '" << category << "': " << message << std::endl;
30 }
31};
32
33int main(int argc, char** argv)
34{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected