DUDS
Distributed Update of Data from Something
Conversation.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2017 Jeff Jackowski
9  */
11 
12 namespace duds { namespace hardware { namespace interface {
13 
14 /*
15 Conversation::Conversation(const Conversation &msg) {
16  PartVector::const_iterator iter = msg.parts.cbegin();
17  std::for_each(iter, msg.parts.cend(), [this](auto uptr) {
18  // copy() makes copy of part; but how with the types?
19  data.push_back(copy(uptr));
20  }
21 }
22 
23 Conversation::Conversation(const Conversation &msg, CopyExtractible) {
24 }
25 
26 Conversation::Conversation(Conversation &msg, MoveExtractible) {
27 }
28 */
29 
31  ConversationVector *cv =
33  parts.emplace_back(cv);
34  return *cv;
35 }
36 
38  ConversationVector *cv =
40  parts.emplace_back(cv);
41  return *cv;
42 }
43 
45  const char *a,
46  std::size_t len
47 ) {
49  parts.emplace_back(ce);
50  return *ce;
51 }
52 
55  parts.emplace_back(ce);
56  return *ce;
57 }
58 
60  return ConversationExtractor(*this);
61 }
62 
63 } } }
Used as a parameter to constructors to specify that communication will not change the length of the c...
ConversationExternal & addOutputBuffer(const char *a, std::size_t len)
Adds a conversation part that will use the given buffer for output.
ConversationVector & addInputVector(std::size_t len)
Creates a new ConversationVector for fixed length input and initializes it with the given length...
Header for ConversationExtractor; includes all other conversation related header files.
References a conversation part in an externally controlled buffer.
Used as a parameter to constructors to specify an output conversation part.
PartVector parts
The container of the parts that make up the full conversation.
ConversationExtractor extract() const
Returns an extraction object that can be used to read all the conversation data marked extractible...
ConversationVector & addOutputVector()
Creates a new ConversationVector for output and returns it for modification.
Extracts data from a Conversation without modifying the Conversation or copying from it...
ConversationExternal & addInputBuffer(char *a, std::size_t len)
Adds a conversation part that will write input into the given buffer.
Holds a conversation part inside a vector.