21 template <
typename StreamStateT>
47 return state->MakeBuffer();
51 template <
typename... Buffers>
52 void Write(Buffers &&... buffers) {
60 buffer.copy_from(data);
61 Write(std::move(buffer));
74 Stream(std::shared_ptr<StreamStateT> state)
This file contains definitions of common data structures used in traffic manager. ...
Stream(std::shared_ptr< StreamStateT > state)
#define DEBUG_ASSERT(predicate)
Stream & operator<<(const T &data)
Make a copy of data and flush it down the stream.
A token that uniquely identify a stream.
Token token() const
Token associated with this stream.
Keeps the mapping between streams and sessions.
Buffer MakeBuffer()
Pull a buffer from the buffer pool associated to this stream.
Stream & operator=(const Stream &)=default
bool AreClientsListening()
std::shared_ptr< StreamStateT > _shared_state
void Write(Buffers &&... buffers)
Flush buffers down the stream. No copies are made.