qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1
24
25#ifndef QB_IO_ASYNC_FILE_H
26#define QB_IO_ASYNC_FILE_H
27
28#include "../transport/file.h"
29#include "io.h"
30
31namespace qb::io::async {
32
43template <typename _Derived>
44class file
45 : public file_watcher<_Derived>
47 using base_t = file_watcher<_Derived>;
48 friend base_t;
49
50public:
55
62
63public:
71 explicit file() {
72 if constexpr (has_member_Protocol<_Derived>::value) {
73 if constexpr (!std::is_void_v<typename _Derived::Protocol>) {
75 static_cast<_Derived &>(*this));
76 }
77 }
78 }
79
88 inline uint64_t
89 ident() noexcept {
90 return static_cast<_Derived &>(*this).transport().native_handle();
91 }
92};
93
94} // namespace qb::io::async
95
96#endif // QB_IO_ASYNC_FILE_H
file_watcher()=default
Default constructor.
_Protocol * switch_protocol(_Args &&...args)
Switches to a new protocol for processing file contents, taking ownership.
Definition io.h:310
file()
< Import the transport method from the file transport
Definition file.h:71
typename qb::io::transport::file::transport_io_type transport_io_type
Type of the underlying transport IO.
Definition file.h:54
uint64_t ident() noexcept
Get a unique identifier for the file.
Definition file.h:89
input_buffer_type & in() noexcept
Definition stream.h:94
io::sys::file transport_io_type
Definition stream.h:52
io::sys::file & transport() noexcept
Definition stream.h:76
output_buffer_type & out() noexcept
Definition stream.h:328
File transport providing stream-based access to local files.
Definition file.h:42
Core asynchronous I/O class templates for event-driven operations.
File transport implementation for the QB IO library.