![]() |
RflySimSDK v3.05
RflySimSDK说明文档
|
Header allowing use of a output stream-style method of sending text messages from devices. Contains the operator<< overload needed to stream into a vrpn_BaseClassUnique::SendTextMessageBoundCall, and the proxy object containing an ostringstream that executes the bound call when it's done having data streamed in to it. 更多...
类 | |
class | vrpn_SendTextMessageStreamProxy |
函数 | |
template<typename T > | |
vrpn_SendTextMessageStreamProxy | operator<< (vrpn_BaseClassUnique::SendTextMessageBoundCall const &call, T const &firstData) |
Header allowing use of a output stream-style method of sending text messages from devices. Contains the operator<< overload needed to stream into a vrpn_BaseClassUnique::SendTextMessageBoundCall, and the proxy object containing an ostringstream that executes the bound call when it's done having data streamed in to it.
This is a separate header to avoid including <sstream> in vrpn_BaseClass.h since the functionality is only used by device implementations themselves, and not even all of them. Further, since we create the stream proxy only once we've seen an operator<< (rather than as a part of the bound call), we know that if a stream proxy exists, it has a message to send.
vrpn_SendTextMessageStreamProxy operator<< | ( | vrpn_BaseClassUnique::SendTextMessageBoundCall const & | call, |
T const & | firstData ) |
Templated operator << that takes a vrpn_BaseClassUnique::SendTextMessageBoundCall on the left, and some data on the right, and uses that to initialize and return a temporary vrpn_SendTextMessageStreamProxy who will be able to accept additional streamed data before making the send_text_message call in its destructor at the end of the statement.