5cbda834bd
GitOrigin-RevId: 1369d3af1195221f6ddb9462d5f8b74fb5fef20f
33 lines
961 B
C++
33 lines
961 B
C++
//
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2018
|
|
//
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
//
|
|
#pragma once
|
|
|
|
#include "td/utils/common.h"
|
|
#include "td/utils/port/Fd.h"
|
|
#include "td/utils/Status.h"
|
|
|
|
namespace td {
|
|
class EventFdBase {
|
|
public:
|
|
EventFdBase() = default;
|
|
EventFdBase(const EventFdBase &) = delete;
|
|
EventFdBase &operator=(const EventFdBase &) = delete;
|
|
EventFdBase(EventFdBase &&) = default;
|
|
EventFdBase &operator=(EventFdBase &&) = default;
|
|
virtual ~EventFdBase() = default;
|
|
|
|
virtual void init() = 0;
|
|
virtual bool empty() = 0;
|
|
virtual void close() = 0;
|
|
virtual const Fd &get_fd() const = 0;
|
|
virtual Fd &get_fd() = 0;
|
|
virtual Status get_pending_error() TD_WARN_UNUSED_RESULT = 0;
|
|
virtual void release() = 0;
|
|
virtual void acquire() = 0;
|
|
};
|
|
} // namespace td
|