All Frameworks Class Hierarchy This Framework Previous Next Indexes
System.IUnknown | +---System.IDispatch | +---System.CATBaseUnknown | +---CATIStreamMsg
Usage: you can freely reimplement this interface.
interface CATIStreamMsg
Interface to stream and unstream backbone messages.
Role: This interface must be implemented by backbone messages
to enable their streaming and unstreaming.
If your message contains simple data types, use the methods of the CATIBBStreamer interface implemented by the CATBBMessage component.
public virtual HRESULT FreeStreamData( | void* | Buffer, |
uint32 | iLength)=0 |
HRESULT FreeStreamData(void *Buffer, uint32 iLength) { ... CATIBBStreamer * pICATIBBStreamer = NULL ; HRESULT rc = QueryInterface(IID_CATIBBStreamer,(void**)&pICATIBBStreamer); if ( SUCCEEDED(rc) ) { pICATIBBStreamer->ResetStreamData(); // free simple data types at once pICATIBBStreamer->Release(); pICATIBBStreamer = NULL ; } ... // free other data }
public virtual HRESULT SetMessageSpecifications( | )=0 |
HRESULT SetMessageSpecifications() { ... CATICommMsg * pICATICommMsg = NULL; HRESULT rc = QueryInterface(IID_CATICommMsg,(void**)&pICATICommMsg); if ( SUCCEEDED(rc) ) { // To set the message class name (mandatory) // MessageClassName is the name of the component. pICATICommMsg->SetMessageClass(MessageClassName); // To set options (if necessary) pICATICommMsg->SetMessageSpecifiers(..|..|..); pICATICommMsg->Release(); pICATICommMsg = NULL; } }
public virtual HRESULT StreamData( | void** | oBuffer, |
uint32* | oLength)=0 |
HRESULT StreamData( void **oBuffer, uint32 *oLength) { ... CATIBBStreamer * pICATIBBStreamer = NULL ; HRESULT rc = QueryInterface(IID_CATIBBStreamer,(void**)&pICATIBBStreamer); // stream simple data types if ( SUCCEEDED(rc) ) { // Begin by this instruction pICATIBBStreamer->BeginStream(); // Stream each message data according to its type // ---------------------------------------------- pICATIBBStreamer->StreamFloat(..); pICATIBBStreamer->StreamInt(..); // End by these 3 instructions int Length; *oBuffer = pICATIBBStreamer->EndStream(&Length); *oLength = Length ; pICATIBBStreamer->Release(); pICATIBBStreamer = NULL; } ... // stream other data and update oLength }
public virtual HRESULT UnstreamData( | void* | iBuffer, |
uint32 | iLength)=0 |
HRESULT UnstreamData(void *iBuffer, uint32 iLength) { ... CATIBBStreamer * pICATIBBStreamer = NULL; HRESULT rc = QueryInterface(IID_CATIBBStreamer,(void**)&pICATIBBStreamer); // unstream simple data types if ( SUCCEEDED(rc) ) { // Begin by this instruction pICATIBBStreamer->BeginUnstream(iBuffer, iLength); // Unstream message data (in the same order as when streaming) // according to its type // ----------------------------------------------------------- pICATIBBStreamer->UnstreamFloat(..); pICATIBBStreamer->UnstreamInt(..); ... // -------------------------- // End by this instruction pICATIBBStreamer->EndUnstream(); pICATIBBStreamer->Release(); pICATIBBStreamer = NULL; } ... // unstream other data }
Copyright © 2003, Dassault Systèmes. All rights reserved.