2018-10-15 01:44:54 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CharacterDevice.h"
|
|
|
|
|
|
|
|
class RandomDevice final : public CharacterDevice {
|
2018-11-01 01:19:15 +03:00
|
|
|
AK_MAKE_ETERNAL
|
2018-10-15 01:44:54 +03:00
|
|
|
public:
|
|
|
|
RandomDevice();
|
2018-10-25 14:07:59 +03:00
|
|
|
virtual ~RandomDevice() override;
|
2018-10-15 01:44:54 +03:00
|
|
|
|
2019-07-03 22:17:35 +03:00
|
|
|
static u32 random_value();
|
2019-03-18 06:03:44 +03:00
|
|
|
|
2019-01-21 04:33:01 +03:00
|
|
|
private:
|
|
|
|
// ^CharacterDevice
|
2019-07-03 22:17:35 +03:00
|
|
|
virtual ssize_t read(FileDescription&, u8*, ssize_t) override;
|
|
|
|
virtual ssize_t write(FileDescription&, const u8*, ssize_t) override;
|
2019-06-07 10:36:51 +03:00
|
|
|
virtual bool can_read(FileDescription&) const override;
|
|
|
|
virtual bool can_write(FileDescription&) const override { return true; }
|
2019-01-21 04:33:01 +03:00
|
|
|
virtual const char* class_name() const override { return "RandomDevice"; }
|
2018-10-15 01:44:54 +03:00
|
|
|
};
|