IXWebSocket/ixwebsocket/IXSelectInterrupt.h

35 lines
750 B
C
Raw Normal View History

2019-03-15 02:37:38 +01:00
/*
* IXSelectInterrupt.h
* Author: Benjamin Sergeant
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
*/
#pragma once
#include <memory>
2019-03-15 02:37:38 +01:00
#include <stdint.h>
#include <string>
namespace ix
{
2019-05-30 17:46:50 +02:00
class SelectInterrupt
{
2019-03-15 02:37:38 +01:00
public:
SelectInterrupt();
virtual ~SelectInterrupt();
virtual bool init(std::string& errorMsg);
virtual bool notify(uint64_t value);
virtual bool clear();
virtual uint64_t read();
2019-03-15 19:41:57 +01:00
virtual int getFd() const;
// Used as special codes for pipe communication
static const uint64_t kSendRequest;
static const uint64_t kCloseRequest;
2019-03-15 02:37:38 +01:00
};
using SelectInterruptPtr = std::unique_ptr<SelectInterrupt>;
2019-05-30 17:46:50 +02:00
} // namespace ix