OutboundPacketStream& OutboundPacketStream::operator<<( float rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = FLOAT_TYPE_TAG; #ifdef OSC_HOST_LITTLE_ENDIAN union{ float f; char c[4]; } u; u.f = rhs; argumentCurrent_[3] = u.c[0]; argumentCurrent_[2] = u.c[1]; argumentCurrent_[1] = u.c[2]; argumentCurrent_[0] = u.c[3]; #else *reinterpret_cast<float*>(argumentCurrent_) = rhs; #endif argumentCurrent_ += 4; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( double rhs ) { CheckForAvailableArgumentSpace(8); *(--typeTagsCurrent_) = DOUBLE_TYPE_TAG; #ifdef OSC_HOST_LITTLE_ENDIAN union{ double f; char c[8]; } u; u.f = rhs; argumentCurrent_[7] = u.c[0]; argumentCurrent_[6] = u.c[1]; argumentCurrent_[5] = u.c[2]; argumentCurrent_[4] = u.c[3]; argumentCurrent_[3] = u.c[4]; argumentCurrent_[2] = u.c[5]; argumentCurrent_[1] = u.c[6]; argumentCurrent_[0] = u.c[7]; #else *reinterpret_cast<double*>(argumentCurrent_) = rhs; #endif argumentCurrent_ += 8; return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( bool rhs ) { CheckForAvailableArgumentSpace(0); *(--typeTagsCurrent_) = (char)((rhs) ? TRUE_TYPE_TAG : FALSE_TYPE_TAG); return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( bool rhs ) { CheckForAvailableArgumentSpace(0); *(--typeTagsCurrent_) = (char)((rhs) ? TRUE_TYPE_TAG : FALSE_TYPE_TAG); return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( const NxDeviceOscInfinitumType& rhs ) { (void) rhs; CheckForAvailableArgumentSpace(0); *(--typeTagsCurrent_) = INFINITUM_TYPE_TAG; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const HashInitiator& rhs ) { (void) rhs; CheckForAvailableArgumentSpace(0); *(--typeTagsCurrent_) = HASH_BEGIN_TYPE_TAG; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<(const NilType& rhs) { (void)rhs; CheckForAvailableArgumentSpace(0); *--typeTagsCurrent_ = NIL_TYPE_TAG; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const InfinitumType& rhs ) { (void) rhs; CheckForAvailableArgumentSpace(0); *(--typeTagsCurrent_) = INFINITUM_TYPE_TAG; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const ArrayTerminator& rhs ) { (void) rhs; CheckForAvailableArgumentSpace(0); *(--typeTagsCurrent_) = ARRAY_END_TYPE_TAG; return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( int64 rhs ) { CheckForAvailableArgumentSpace(8); *(--typeTagsCurrent_) = INT64_TYPE_TAG; FromInt64( argumentCurrent_, rhs ); argumentCurrent_ += 8; return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( const NxDeviceOscMidiMessage& rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = MIDI_MESSAGE_TYPE_TAG; FromUInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( const NxDeviceOscRgbaColor& rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = RGBA_COLOR_TYPE_TAG; FromUInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( char rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = CHAR_TYPE_TAG; FromInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( const NxDeviceOscTimeTag& rhs ) { CheckForAvailableArgumentSpace(8); *(--typeTagsCurrent_) = TIME_TAG_TYPE_TAG; FromUInt64( argumentCurrent_, rhs ); argumentCurrent_ += 8; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( bool rhs ) { state_ = CheckForAvailableArgumentSpace(0); if(state_ == SUCCESS) { *(--typeTagsCurrent_) = (char)((rhs) ? TRUE_TYPE_TAG : FALSE_TYPE_TAG); } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( int64 rhs ) { CheckForAvailableArgumentSpace(8); *(--typeTagsCurrent_) = INT64_TYPE_TAG; FromInt64( argumentCurrent_, rhs ); argumentCurrent_ += 8; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const TimeTag& rhs ) { CheckForAvailableArgumentSpace(8); *(--typeTagsCurrent_) = TIME_TAG_TYPE_TAG; FromUInt64( argumentCurrent_, rhs ); argumentCurrent_ += 8; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const RgbaColor& rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = RGBA_COLOR_TYPE_TAG; FromUInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const MidiMessage& rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = MIDI_MESSAGE_TYPE_TAG; FromUInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( char rhs ) { CheckForAvailableArgumentSpace(4); *(--typeTagsCurrent_) = CHAR_TYPE_TAG; FromInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const ArrayInitiator& rhs ) { (void) rhs; state_ = CheckForAvailableArgumentSpace(0); if(state_ == SUCCESS) { *(--typeTagsCurrent_) = ARRAY_BEGIN_TYPE_TAG; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const NilType& rhs ) { (void) rhs; state_ = CheckForAvailableArgumentSpace(0); if(state_ == SUCCESS) { *(--typeTagsCurrent_) = NIL_TYPE_TAG; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( int32 rhs ) { state_ = CheckForAvailableArgumentSpace(4); if(state_ == SUCCESS) { *(--typeTagsCurrent_) = INT32_TYPE_TAG; FromInt32( argumentCurrent_, rhs ); argumentCurrent_ += 4; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const Symbol& rhs ) { CheckForAvailableArgumentSpace( RoundUp4(strlen(rhs) + 1) ); *(--typeTagsCurrent_) = SYMBOL_TYPE_TAG; strcpy( argumentCurrent_, rhs ); unsigned long rhsLength = strlen(rhs); argumentCurrent_ += rhsLength + 1; // zero pad to 4-byte boundary unsigned long i = rhsLength + 1; while( i & 0x3 ){ *argumentCurrent_++ = '\0'; ++i; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<(const char* rhs) { CheckForAvailableArgumentSpace(RoundUp4(static_cast<long>(strlen(rhs)) + 1)); *--typeTagsCurrent_ = STRING_TYPE_TAG; strcpy(argumentCurrent_, rhs); unsigned long rhsLength = static_cast<unsigned long>(strlen(rhs)); argumentCurrent_ += rhsLength + 1; // zero pad to 4-byte boundary unsigned long i = rhsLength + 1; while (i & 0x3) { *argumentCurrent_++ = '\0'; ++i; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const char *rhs ) { CheckForAvailableArgumentSpace( RoundUp4(std::strlen(rhs) + 1) ); *(--typeTagsCurrent_) = STRING_TYPE_TAG; std::strcpy( argumentCurrent_, rhs ); std::size_t rhsLength = std::strlen(rhs); argumentCurrent_ += rhsLength + 1; // zero pad to 4-byte boundary std::size_t i = rhsLength + 1; while( i & 0x3 ){ *argumentCurrent_++ = '\0'; ++i; } return *this; }
NxDeviceOscOutputMessage& NxDeviceOscOutputMessage::operator<<( const char *rhs ) { CheckForAvailableArgumentSpace( RoundUp4(strlen(rhs) + 1) ); *(--typeTagsCurrent_) = STRING_TYPE_TAG; strcpy( argumentCurrent_, rhs ); unsigned long rhsLength = strlen(rhs); argumentCurrent_ += rhsLength + 1; // zero pad to 4-byte boundary unsigned long i = rhsLength + 1; while( i & 0x3 ){ *argumentCurrent_++ = '\0'; ++i; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const Blob& rhs ) { CheckForAvailableArgumentSpace( 4 + RoundUp4(rhs.size) ); *(--typeTagsCurrent_) = BLOB_TYPE_TAG; FromUInt32( argumentCurrent_, rhs.size ); argumentCurrent_ += 4; memcpy( argumentCurrent_, rhs.data, rhs.size ); argumentCurrent_ += rhs.size; // zero pad to 4-byte boundary unsigned long i = rhs.size; while( i & 0x3 ){ *argumentCurrent_++ = '\0'; ++i; } return *this; }
OutboundPacketStream& OutboundPacketStream::operator<<( const Symbol& rhs ) { state_ = CheckForAvailableArgumentSpace( RoundUp4(std::strlen(rhs) + 1) ); if(state_ == SUCCESS) { *(--typeTagsCurrent_) = SYMBOL_TYPE_TAG; std::strcpy( argumentCurrent_, rhs ); std::size_t rhsLength = std::strlen(rhs); argumentCurrent_ += rhsLength + 1; // zero pad to 4-byte boundary std::size_t i = rhsLength + 1; while( i & 0x3 ){ *argumentCurrent_++ = '\0'; ++i; } } return *this; }