blob: 7f54b812e6bb898bccadf533109b80807de377c7 [file] [log] [blame]
#pragma once
#include <gpioplus/internal/sys.hpp>
namespace gpioplus
{
namespace internal
{
class Fd
{
public:
Fd(const char* pathname, int flags, const Sys* sys);
Fd(int fd, const Sys* sys);
~Fd();
Fd(const Fd& other);
Fd& operator=(const Fd& other);
Fd(Fd&& other);
Fd& operator=(Fd&& other);
int operator*() const;
const Sys* getSys() const;
void setBlocking(bool enabled) const;
private:
const Sys* sys;
int fd;
void setFlags(int flags) const;
int getFlags() const;
void reset();
};
} // namespace internal
} // namespace gpioplus