16 #ifndef THRILL_NET_MOCK_GROUP_HEADER 17 #define THRILL_NET_MOCK_GROUP_HEADER 53 bool IsValid() const final {
return true; }
68 const void* data,
size_t size,
Flags flags =
NoFlags)
final;
75 void SyncRecv(
void* out_data,
size_t size)
final;
77 ssize_t
RecvOne(
void* out_data,
size_t size)
final;
84 void SyncSendRecv(
const void* send_data,
size_t send_size,
85 void* recv_data,
size_t recv_size)
final;
86 void SyncRecvSend(
const void* send_data,
size_t send_size,
87 void* recv_data,
size_t recv_size)
final;
105 std::unique_ptr<Data>
d_;
118 static constexpr
bool debug =
false;
119 static constexpr
bool debug_data =
true;
126 Group(
size_t my_rank,
size_t group_size);
130 size_t num_hosts() const final;
132 net::
Connection& connection(
size_t peer) final;
138 std::
unique_ptr<net::Dispatcher> ConstructDispatcher() const final;
150 static
std::
string MaybeHexdump(const
void* data,
size_t size);
171 class Dispatcher final : public net::Dispatcher
173 static constexpr
bool debug =
false;
191 void Notify(Connection* c);
193 void Interrupt() final;
210 Watch& GetWatch(Connection* c);
219 #endif // !THRILL_NET_MOCK_GROUP_HEADER std::chrono::milliseconds milliseconds
import into class namespace
size_t peer_
Outgoing peer id of this Connection.
The central object of a mock network: the Group containing links to other mock Group forming the netw...
ssize_t RecvOne(void *out_data, size_t size) final
std::string ToString() const final
return a string representation of this connection, for user output.
void SyncRecv(void *out_data, size_t size) final
tlx::delegate< bool(), mem::GPoolAllocator< char > > AsyncCallback
Signature of async connection readability/writability callbacks.
A virtual connection through the mock network: each Group has p Connections to its peers...
ssize_t SendOne(const void *data, size_t size, Flags flags=NoFlags) final
std::enable_if< std::is_pod< T >::value, void >::type Send(const T &value)
A virtual Dispatcher which waits for messages to arrive in the mock network.
bool IsValid() const final
check whether the connection is (still) valid.
void SyncSendRecv(const void *send_data, size_t send_size, void *recv_data, size_t recv_size) final
std::unique_ptr< Data > d_
pimpl data struct with complex components
A Connection represents a link to another peer in a network group.
std::ostream & OutputOstream(std::ostream &os) const final
virtual method to output to a std::ostream
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
static constexpr bool debug
std::vector< T, Allocator< T > > vector
vector with Manager tracking
void Initialize(Group *group, size_t peer)
construct from mock::Group
A network Group is a collection of enumerated communication links, which provides point-to-point comm...
void SyncSend(const void *data, size_t size, Flags=NoFlags) final
void InboundMsg(net::Buffer &&msg)
Method which is called by other peers to enqueue a message.
friend class Dispatcher
for access to watch lists and mutex.
Simple buffer of characters without initialization or growing functionality.
net::Buffer RecvNext()
some-what internal function to extract the next packet from the queue.
Flags
Additional flags for sending or receiving.
std::unique_ptr< T, Deleter< T > > unique_ptr
unique_ptr with Manager tracking
void SyncRecvSend(const void *send_data, size_t send_size, void *recv_data, size_t recv_size) final
Group * group_
Reference to our group.