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