Abstract data buffer.
More...
Abstract data buffer.
Definition at line 246 of file virtio.
◆ Data_buffer()
template<typename T >
L4virtio::Svr::Data_buffer::Data_buffer |
( |
T * |
p | ) |
|
|
inlineexplicit |
Create buffer for object p.
- Template Parameters
-
T | type of object (implicit) |
- Parameters
-
The buffer shall point to the start of the object p and the size left is sizeof(T).
Definition at line 262 of file virtio.
◆ copy_to()
Copy contents from this buffer to the destination buffer.
- Parameters
-
dst | Destination buffer. |
max | (optional) Maximum number of bytes to copy. |
- Returns
- the number of bytes copied.
This function copies at most max
bytes from this to dst
. If max
is omitted, copies the maximum number of bytes available that fit dst
.
Definition at line 291 of file virtio.
References left, cxx::max(), cxx::min(), and pos.
◆ done()
bool L4virtio::Svr::Data_buffer::done |
( |
| ) |
const |
|
inline |
Check if there are no more bytes left in the buffer.
- Returns
- true if there are no more bytes left in the buffer.
Definition at line 323 of file virtio.
◆ set()
template<typename T >
void L4virtio::Svr::Data_buffer::set |
( |
T * |
p | ) |
|
|
inline |
Set buffer for object p.
- Template Parameters
-
T | type of object (implicit) |
- Parameters
-
The buffer shall point to the start of the object p and the size left is sizeof(T).
Definition at line 275 of file virtio.
◆ skip()
Skip given number of bytes in this buffer.
- Parameters
-
bytes | Number of bytes that shall be skipped. |
- Returns
- The number of bytes skipped.
Try to skip the given number of bytes in this buffer, if there are less bytes left in the buffer that given then at most left bytes are skipped and the amount is returned.
Definition at line 311 of file virtio.
References cxx::min().
The documentation for this struct was generated from the following file: