libcosmos
Linux C++ System Programming Library
Loading...
Searching...
No Matches
cosmos::InputMemoryRegion Struct Reference

IOMemoryRegion for input (read) operations. More...

#include <iovector.hxx>

+ Inheritance diagram for cosmos::InputMemoryRegion:

Public Member Functions

 InputMemoryRegion (void *base, size_t length)
 
 InputMemoryRegion (std::string &s)
 
auto asIovec ()
 
- Public Member Functions inherited from cosmos::IOMemoryRegion< struct ::iovec >
auto getBase ()
 
auto getBase () const
 
void setBase (PtrType base)
 
size_t getLength () const
 
void setLength (size_t length)
 
bool finished () const
 
size_t update (const size_t processed_bytes)
 Update the current memory region to accommodate the given number of processed bytes.
 

Additional Inherited Members

- Public Types inherited from cosmos::IOMemoryRegion< struct ::iovec >
using PtrType
 

Detailed Description

IOMemoryRegion for input (read) operations.

This variant of an IOVector entry holds a non-const base pointer for writing into.

Definition at line 100 of file iovector.hxx.

Constructor & Destructor Documentation

◆ InputMemoryRegion() [1/3]

cosmos::InputMemoryRegion::InputMemoryRegion ( )
inline

Definition at line 103 of file iovector.hxx.

103: InputMemoryRegion{nullptr, 0} {}

◆ InputMemoryRegion() [2/3]

cosmos::InputMemoryRegion::InputMemoryRegion ( void * base,
size_t length )
inline

Definition at line 105 of file iovector.hxx.

105 {
106 setBase(base);
107 setLength(length);
108 }

◆ InputMemoryRegion() [3/3]

cosmos::InputMemoryRegion::InputMemoryRegion ( std::string & s)
inlineexplicit

Definition at line 110 of file iovector.hxx.

110 {
111 setBase(s.data());
112 setLength(s.size());
113 }

Member Function Documentation

◆ asIovec()

auto cosmos::InputMemoryRegion::asIovec ( )
inline

Definition at line 115 of file iovector.hxx.

115 {
116 return static_cast<struct iovec*>(this);
117 }

The documentation for this struct was generated from the following file: