| Support Forum G3D Web Page |
Iterates through new messages on a NetConnection. More...
Public Member Functions | |
| NetMessageIterator & | begin () |
| BinaryInput & | binaryInput () const |
| A BinaryInput for the current message. More... | |
| NetChannel | channel () const |
| Application-defined channel on which this message was sent. More... | |
| void * | data () const |
| The raw data bytes for the current message. More... | |
| NetMessageIterator & | end () const |
| BinaryInput & | headerBinaryInput () const |
| A BinaryInput for the current message's header. More... | |
| bool | isValid () const |
| True if the data() and binaryInput() can be accessed for this message. More... | |
| bool | operator!= (const NetMessageIterator &other) const |
| NetMessageIterator & | operator++ () |
| Advance to the next message and deallocate the object referenced by binaryInput. More... | |
| bool | operator== (NetMessageIterator &other) const |
| size_t | size () const |
| Size of the data in bytes for the current message. More... | |
| NetMessageType | type () const |
| Application-defined type header for this message. More... | |
Protected Member Functions | |
| NetMessageIterator () | |
Protected Attributes | |
| weak_ptr< NetConnection > | m_connection |
| The connection that owns the queue. More... | |
| shared_ptr< _internal::NetMessageQueue > | m_queue |
Static Protected Attributes | |
| static NetMessageIterator | s_doneIterator |
Friends | |
| class | _internal::NetClientSideConnection |
| class | NetConnection |
| class | NetServer |
Iterates through new messages on a NetConnection.
Note that a DISCONNECTED NetConnection may still have messages waiting in its queue to be processed.
Note that it is not possible to construct a NetMessageIterator (since nothing good could happen with it), so this must be initialized with a reference, e.g.,
NetMessageIterator& msg = connection->incomingMessageIterator();
|
protected |
|
inline |
| BinaryInput& G3D::NetMessageIterator::binaryInput | ( | ) | const |
A BinaryInput for the current message.
This is allocated on demand and deallocated when the iterator is incremented with operator++. It is shared across copies of the iterator.
| NetChannel G3D::NetMessageIterator::channel | ( | ) | const |
Application-defined channel on which this message was sent.
| void* G3D::NetMessageIterator::data | ( | ) | const |
The raw data bytes for the current message.
|
inline |
| BinaryInput& G3D::NetMessageIterator::headerBinaryInput | ( | ) | const |
A BinaryInput for the current message's header.
This is allocated on demand and deallocated when the iterator is incremented with operator++. It is shared across copies of the iterator.
| bool G3D::NetMessageIterator::isValid | ( | ) | const |
True if the data() and binaryInput() can be accessed for this message.
Referenced by begin().
|
inline |
| NetMessageIterator& G3D::NetMessageIterator::operator++ | ( | ) |
Advance to the next message and deallocate the object referenced by binaryInput.
Returns end() when the iterator is empty.
|
inline |
| size_t G3D::NetMessageIterator::size | ( | ) | const |
Size of the data in bytes for the current message.
| NetMessageType G3D::NetMessageIterator::type | ( | ) | const |
Application-defined type header for this message.
|
friend |
|
friend |
|
friend |
|
protected |
The connection that owns the queue.
|
protected |
|
staticprotected |
1.8.15