|
DUDS
|
Distributed Update of Data from Something
|
References a conversation part in an externally controlled buffer. More...
#include <ConversationExternal.hpp>
Public Member Functions | |
| ConversationExternal (const ConversationExternal &)=default | |
| Copies are ok. More... | |
| ConversationExternal (const char *a, std::size_t length, Flags flags=Flags::Zero()) | |
| Creates an output part from the given buffer. More... | |
| ConversationExternal (char *a, std::size_t length, Flags flags=MpfInput) | |
| Creates an input part from the given buffer. More... | |
| template<typename T , std::size_t N> | |
| ConversationExternal (const T(&a)[N], Flags f=Flags::Zero()) | |
| Creates an output part from the given array. More... | |
| template<typename T , std::size_t N> | |
| ConversationExternal (T(&a)[N], Flags f=MpfInput) | |
| Creates an input part from the given array. More... | |
| virtual std::size_t | length () const |
| Returns the length of the buffer following the start pointer. More... | |
| virtual char * | start () const |
| Returns a pointer to the begining of the conversation part's buffer. More... | |
Public Member Functions inherited from duds::hardware::interface::ConversationPart | |
| ConversationPart (const ConversationPart &)=default | |
| Copies are OK. More... | |
| virtual | ~ConversationPart () |
| bool | bigEndian () const |
| True if this part is flagged as having data in big-endian form. More... | |
| ConversationPart & | bigEndian (bool big) |
| Changes the flagged endianess of this part. More... | |
| ConversationPart & | breakBefore () |
| Flags the conversation part to have a break before this part is sent. More... | |
| bool | extract () const |
| True if this part is flagged for extraction by ConversationExtractor. More... | |
| ConversationPart & | extract (bool ex) |
| Changes the extraction flag for this part. More... | |
| Flags | flags () const |
| Returns the flags. More... | |
| bool | input () const |
| True if this part is flagged for input use. More... | |
| bool | littleEndian () const |
| True if this part is flagged as having data in little-endian form. More... | |
| ConversationPart & | littleEndian (bool little) |
| Changes the flagged endianess of this part. More... | |
| bool | output () const |
| True if this part is flagged for output use. More... | |
| bool | varyingLength () const |
| True if this part is flagged as having a variable length. More... | |
Private Attributes | |
| char * | data |
| Points to the start of the external buffer. More... | |
| std::size_t | len |
| Length of the external buffer. More... | |
Additional Inherited Members | |
Public Types inherited from duds::hardware::interface::ConversationPart | |
| typedef duds::general::BitFlags< struct ConversationPartFlags, std::uint16_t > | Flags |
| The type used to store flags that modify the operation of the classes derived from this class, or how the objects are used. More... | |
Static Public Attributes inherited from duds::hardware::interface::ConversationPart | |
| static constexpr Flags | MpfBigendian = Flags::Bit(3) |
| True/set to expect data to be big-endian. More... | |
| static constexpr Flags | MpfBreak = Flags::Bit(4) |
| True/set to indicate that any kind of selection signal should be toggled, or a stop condition should occur, before communicating the part with this flag. More... | |
| static constexpr Flags | MpfExtract = Flags::Bit(1) |
| True/set to extract message part contents with the ConversationExtractor. More... | |
| static constexpr Flags | MpfInput = Flags::Bit(0) |
| True/set for input; false for output. More... | |
| static constexpr Flags | MpfVarlen = Flags::Bit(2) |
| True/set for a varying length; valid only for input. More... | |
Protected Member Functions inherited from duds::hardware::interface::ConversationPart | |
| ConversationPart (Flags f) | |
| Construct with the given flags. More... | |
| ConversationPart (Flags f, std::int16_t v) | |
| Construct with the given flags and an initial value for val16. More... | |
Protected Attributes inherited from duds::hardware::interface::ConversationPart | |
| std::int16_t | val16 |
| A small integer for derived classes to use. More... | |
References a conversation part in an externally controlled buffer.
The contents of the buffer are not copied for output parts, nor are they ever modified. Input parts will have new data writen directly into the buffer.
Definition at line 21 of file ConversationExternal.hpp.
|
default |
Copies are ok.
|
inline |
Creates an output part from the given buffer.
| a | The start of the buffer with the output data. It is not copied; any changes to the buffer will affect the containing Conversation. |
| length | The length of the buffer in bytes. |
| flags | Flags that modify how the part will be used. |
Definition at line 43 of file ConversationExternal.hpp.
|
inline |
Creates an input part from the given buffer.
| a | The start of the buffer that will take the intput data. |
| length | The length of the buffer in bytes. |
| flags | Flags that modify how the part will be used. |
Definition at line 54 of file ConversationExternal.hpp.
|
inline |
Creates an output part from the given array.
| T | The array element type. It must be an integral type. |
| N | The length of the array. |
| a | The array with the output data. It is not copied; any changes will affect the containing Conversation. |
| f | Flags that modify how the part will be used. |
Definition at line 65 of file ConversationExternal.hpp.
|
inline |
Creates an input part from the given array.
| T | The array element type. It must be an integral type. |
| N | The length of the array. |
| a | The array where the input data will be written. It is handled internally as bytes. Variable length input may require writing a length to the start of the array. Since the size of the length data is implementation dependent, it is best to not use this class for variable length input. |
| f | The flags that modify the operation of the part. |
Definition at line 81 of file ConversationExternal.hpp.
|
virtual |
Returns the length of the buffer following the start pointer.
Implements duds::hardware::interface::ConversationPart.
Definition at line 18 of file ConversationExternal.cpp.
Referenced by ConversationExternal().
|
virtual |
Returns a pointer to the begining of the conversation part's buffer.
The return type is not const because use for input will require a write operation. The implementation must not make changes to the part object, so the function is const.
Implements duds::hardware::interface::ConversationPart.
Definition at line 14 of file ConversationExternal.cpp.
Referenced by ConversationExternal().
|
private |
Points to the start of the external buffer.
Definition at line 25 of file ConversationExternal.hpp.
Referenced by start().
|
private |
Length of the external buffer.
Definition at line 29 of file ConversationExternal.hpp.
Referenced by length().