Class CChannelConnector#
Defined in File com_channel.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Types#
public sdv::IInterfaceAccess
(Struct IInterfaceAccess)public sdv::ipc::IConnectEventCallback
(Struct IConnectEventCallback)public sdv::ipc::IDataReceiveCallback
(Struct IDataReceiveCallback)
Class Documentation#
-
class CChannelConnector : public sdv::IInterfaceAccess, public sdv::ipc::IConnectEventCallback, public sdv::ipc::IDataReceiveCallback#
Communication channel connector (endpoint).
Public Functions
-
CChannelConnector(CCommunicationControl &rcontrol, uint32_t uiIndex, sdv::IInterfaceAccess *pChannelEndpoint)#
Constructor for establishing the server connection.
- Parameters:
rcontrol – [in] Reference to the communication control class.
uiIndex – [in] The current index of this connection (used to create the connection ID).
pChannelEndpoint – [in] Interface pointer to the channel.
-
~CChannelConnector()#
Destructor.
-
bool ServerConnect(sdv::IInterfaceAccess *pObject, bool bAllowReconnect)#
Connect as server (attaching the channel to the target object using a stub).
- Parameters:
pObject – [in] Pointer to the object to attach.
bAllowReconnect – [in] Allow a disconnect and re-connect (disconnect doesn’t trigger a channel removal).
- Returns:
Returns ‘true’ when the attachment succeeds; ‘false’ when not.
-
sdv::IInterfaceAccess *ClientConnect(uint32_t uiTimeoutMs)#
Connect as client (connecting to an existing server and creating a proxy).
- Parameters:
uiTimeoutMs – [in] The timeout time trying to connect.
- Returns:
Returns a pointer to the proxy object representing the object at the other end of the channel. Or NULL when a timeout occurred.
-
bool IsConnected() const#
Is the communication channel currently connected?
- Returns:
Returns whether the connector has an active connection.
-
virtual void SetStatus(sdv::ipc::EConnectStatus eConnectStatus) override#
Set the current status. Overload of sdv::ipc::IConnectEventCallback::SetStatus.
- Parameters:
eConnectStatus – [in] The connection status.
-
virtual void ReceiveData(sdv::sequence<sdv::pointer<uint8_t>> &seqData) override#
Callback to be called by the IPC connection when receiving a data packet. Overload of sdv::ipc::IDataReceiveCallback::ReceiveData.
- Parameters:
seqData – [inout] Sequence of data buffers to received. The sequence might be changed to optimize the communication without having to copy the data.
-
void DecoupledReceiveData(sdv::sequence<sdv::pointer<uint8_t>> &seqData)#
Decoupled receive callback to be called by the scheduler when receiving a data packet.
- Parameters:
seqData – [inout] Sequence of data buffers to received. The sequence might be changed to optimize the communication without having to copy the data.
-
sdv::sequence<sdv::pointer<uint8_t>> MakeCall(sdv::ps::TMarshallID tProxyID, sdv::ps::TMarshallID tStubID, sdv::sequence<sdv::pointer<uint8_t>> &rseqInputData)#
Sends data consisting of multiple data chunks via the IPC connection.
- Parameters:
tProxyID – [in] Marshall ID of the proxy (source).
tStubID – [in] Marshall ID of the stub (target).
rseqInputData – [in] Sequence of data buffers to be sent. May be altered during processing to add/change the sequence content without having to copy the data.
- Returns:
Returns the results of the call or throws a marshall exception.
-
std::shared_ptr<CMarshallObject> GetOrCreateProxy(sdv::interface_id id, sdv::ps::TMarshallID tStubID)#
Get a proxy for the interface connection to the stub.
- Parameters:
id – [in] The ID of the interface this object marshalls the calls for.
tStubID – [in] The stub ID this proxy is communicating to.
- Returns:
Returns a shared pointer to the proxy object.
-
sdv::com::TConnectionID GetConnectionID() const#
Get the connection ID of this connector.
- Returns:
The connection ID.
-
CChannelConnector(CCommunicationControl &rcontrol, uint32_t uiIndex, sdv::IInterfaceAccess *pChannelEndpoint)#