Mat4 Mat4::operator-(const Mat4& right) const { const float *matrix1 = dataPointer(); const float *matrix2 = right.dataPointer(); float matrix3[16]; for (int i = 0; i < 16; ++i) { matrix3[i] = matrix1[i] - matrix2[i]; } return Mat4(matrix3); }
TInt CStatTransportBT::RequestSend( TDesC8 *aData, const TUint aDataLength ) { // make sure the state is correct asserte( iBTTransportStatus == EConnected ); asserte( iRWStatus == ENoRW ); iRWStatus = EWritePending; // copy the data to members to local members if( aDataLength > 0 ) { if( iWrCommandData && ( aDataLength != static_cast<TUint>(iWrCommandData->Length( )) ) ) { delete iWrCommandData; iWrCommandData = NULL; } if( ! iWrCommandData ) { iWrCommandData = HBufC8::New( aDataLength ); if( ! iWrCommandData ) { User::Leave(KErrNoMemory); } } TPtr8 dataPointer( iWrCommandData->Des() ); dataPointer.Copy( aData->Ptr(), aDataLength ); } // do the send asserte( !IsActive() ); asserte( (unsigned)aData->Length() == aDataLength ); iDataSocket.Write( *iWrCommandData, iStatus ); SetActive(); // tell the caller to wait for an asynchronous response return KSTErrAsynchronous; }
/** * Returns a pointer to the resource */ RMRes::operator const byte *() { return dataPointer(); }
DataT* operator->() const { if (!isValid()) throw FlappyException("Invalid handle"); return static_cast<DataT*>(dataPointer()); }