blob: abed0119f620f98e37963dfabfae55744c38eca3 [file] [log] [blame]
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SYZYGY_KASKO_WAITABLE_TIMER_H_
#define SYZYGY_KASKO_WAITABLE_TIMER_H_
#include <windows.h>
namespace kasko {
// Defines an interface for a timer that can be used with the Windows wait
// functions (WaitForSingleObject, WaitForMultipleObjects, etc.). The wait
// interval is determined by the implementation.
class WaitableTimer {
public:
virtual ~WaitableTimer() {}
// Starts the timer.
virtual void Start() = 0;
// Returns a HANDLE that will be signaled when the timer completes.
// @returns an automatically resetting HANDLE compatible with the Windows wait
// functions.
virtual HANDLE GetHANDLE() = 0;
};
} // namespace kasko
#endif // SYZYGY_KASKO_WAITABLE_TIMER_H_