ublk-cpp v0.0
Loading...
Searching...
No Matches
runtime.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <condy.hpp>
9
10namespace ublk {
11
15class RuntimeOptions : public condy::RuntimeOptions {
16public:
21 // NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
22 RuntimeOptions &sq_size(size_t v) noexcept {
23 requested_sq_size_ = v;
24 condy::RuntimeOptions::sq_size(v);
25 return *this;
26 }
27
32 // NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
33 RuntimeOptions &cq_size(size_t v) noexcept {
34 requested_cq_size_ = v;
35 condy::RuntimeOptions::cq_size(v);
36 return *this;
37 }
38
39 condy::RuntimeOptions build(size_t default_sq_size) const noexcept {
40 condy::RuntimeOptions o = *this;
41 o.sq_size(std::max(requested_sq_size_, default_sq_size));
42 o.cq_size(std::max(requested_cq_size_, default_sq_size * 2));
43 return o;
44 }
45
46private:
47 size_t requested_sq_size_ = 0;
48 size_t requested_cq_size_ = 0;
49};
50
51} // namespace ublk
Runtime options for ublk device.
Definition runtime.hpp:15
RuntimeOptions & cq_size(size_t v) noexcept
Set CQ size.
Definition runtime.hpp:33
RuntimeOptions & sq_size(size_t v) noexcept
Set SQ size.
Definition runtime.hpp:22
The main namespace of the ublk-cpp library.
Definition ublk.hpp:21