12 namespace duds {
namespace hardware {
namespace interface {
64 template <
typename T, std::
size_t N>
67 data((char*)(const_cast<T(&)[N]>(a))),
68 len(N * sizeof(T)) { }
80 template <
typename T, std::
size_t N>
83 virtual char *
start()
const;
84 virtual std::size_t
length()
const;
static constexpr Flags MpfInput
True/set for input; false for output.
ConversationExternal(const T(&a)[N], Flags f=Flags::Zero())
Creates an output part from the given array.
static constexpr BitFlags Zero()
Makes a bit flags container with all flags cleared.
ConversationExternal(const ConversationExternal &)=default
Copies are ok.
ConversationExternal(const char *a, std::size_t length, Flags flags=Flags::Zero())
Creates an output part from the given buffer.
References a conversation part in an externally controlled buffer.
Represents a section of a half-duplex conversation with a device.
ConversationExternal(char *a, std::size_t length, Flags flags=MpfInput)
Creates an input part from the given buffer.
Flags flags() const
Returns the flags.
char * data
Points to the start of the external buffer.
virtual std::size_t length() const
Returns the length of the buffer following the start pointer.
virtual char * start() const
Returns a pointer to the begining of the conversation part's buffer.
ConversationExternal(T(&a)[N], Flags f=MpfInput)
Creates an input part from the given array.
std::size_t len
Length of the external buffer.