Line data Source code
1 : /********************************************************************************
2 : * Copyright (c) 2024 Accenture
3 : *
4 : * This program and the accompanying materials are made available under the
5 : * terms of the Apache License Version 2.0 which is available at
6 : * https://www.apache.org/licenses/LICENSE-2.0
7 : *
8 : * SPDX-License-Identifier: Apache-2.0
9 : ********************************************************************************/
10 :
11 : #include "async/AsyncBinding.h"
12 :
13 : namespace async
14 : {
15 26 : TimeoutType::TimeoutType() : _runnable(nullptr), _context(0) {}
16 :
17 2 : void TimeoutType::cancel() { AsyncBindingType::AdapterType::cancel(*this); }
18 :
19 5 : void TimeoutType::expired()
20 : {
21 5 : RunnableType* const runnable = _runnable;
22 5 : if (runnable != nullptr)
23 : {
24 4 : runnable->execute();
25 : }
26 5 : }
27 :
28 : } // namespace async
|