Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cXProtocolRx Class Referenceabstract

#include <cXProtocol.h>

Inheritance diagram for GrayLib::cXProtocolRx:
GrayLib::cXProtocolClient GrayLib::cXProtocolServerStream GrayLib::cXProtocolServerStreamImpl

Protected Member Functions

 cXProtocolRx (cXProtocolBase &rBase, cStreamInput *pStreamRx)
 
virtual ~cXProtocolRx ()
 
virtual HRESULT onX_Error (HRESULT hResRet, const cVariant &vVal)=0
 
virtual HRESULT onXSet_Prop (cXObject *pObj, const cScriptableProp *pProp, const cVariant &vVal)
 
virtual HRESULT onXReq_Invoke (cXObject *pObj, const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet)
 
virtual HRESULT onXSet_PropN (UID_t uidLastRx, const ATOMCHAR_t *pszPropName, ATOMCODE_t nPropName, const cVariant &vVal)
 
virtual HRESULT onXReq_InvokeN (UID_t uidLastRx, const ATOMCHAR_t *pszMethodName, ATOMCODE_t nMethodName, const cVariant &vArgs)
 
virtual HRESULT onXSet_File (const FILECHAR_t *pszReqName, size_t dwTotalLen)
 
void InitRx ()
 
HRESULT ReadUID ()
 
HRESULT on_Error ()
 
HRESULT onSet_PropN ()
 
HRESULT onReq_InvokeN ()
 
HRESULT onSet_File ()
 
HRESULT onSet_FileNext ()
 
cStreamInputget_StreamRx ()
 
virtual HRESULT ProcessStreamRxMsg ()=0
 
virtual HRESULT ProcessStreamPacket ()
 

Protected Attributes

cXProtocolBasem_rBase
 Input stream. More...
 
cStreamInputm_pStreamRx
 Where to RX from. More...
 
SCRIPTINTERFACEID_t m_bInterfaceIDUnk
 An interface received that I don't understand (yet)! client only. More...
 
XPROTO_t m_bMsgReading
 We are in the process of reading/dispatching a message. More...
 
XPROTO_t m_bMsgReadPrev
 Last message i got and understood. for debug. More...
 
int m_iMsgNumRx
 Count the messages we received. More...
 
UID_t m_uidLastRx
 Last UID sent from client. ( be careful order of messages does not change!) More...
 

Detailed Description

General incoming stream of data from client or server

Constructor & Destructor Documentation

◆ cXProtocolRx()

GrayLib::cXProtocolRx::cXProtocolRx ( cXProtocolBase rBase,
cStreamInput pStreamRx 
)
protected

◆ ~cXProtocolRx()

GrayLib::cXProtocolRx::~cXProtocolRx ( )
protectedvirtual

Member Function Documentation

◆ get_StreamRx()

cStreamInput& GrayLib::cXProtocolRx::get_StreamRx ( )
inlineprotected

◆ InitRx()

void GrayLib::cXProtocolRx::InitRx ( )
protected

◆ on_Error()

HRESULT GrayLib::cXProtocolRx::on_Error ( )
protected

XPROTO_Error Always get this back as the first response to hello! Rx side of cXProtocolServerTx::Send_Error

◆ onReq_InvokeN()

HRESULT GrayLib::cXProtocolRx::onReq_InvokeN ( )
protected

XPROTO_InvokeN|XPROTO_Request Server or Client is calling some method (by name) on some object here. may just be an event from client to server. UserClick,etc

◆ onSet_File()

HRESULT GrayLib::cXProtocolRx::onSet_File ( )
protected

XPROTO_File i am getting a file. I probably requested it. is it OK to get this file ?

Note
This can be very large and span multiple XProtocol and/or TCP packets! Opposite of Send_FileChecked() ASSUME szSetFileName is a relative path to m_sFileRootDir. The client has no business knowing full paths on the other side.
Returns
S_FALSE = more to go. S_OK = done.

◆ onSet_FileNext()

HRESULT GrayLib::cXProtocolRx::onSet_FileNext ( )
protected

XPROTO_File|XPROTO_NextChunk Get/Receive the next part of the file.

Note
this can be overridden to do something to the file ?
Returns
S_FALSE = more to go. S_OK = done.

◆ onSet_PropN()

HRESULT GrayLib::cXProtocolRx::onSet_PropN ( )
protected

XPROTO_PropN I got a Prop from the connect.

◆ onX_Error()

virtual HRESULT GrayLib::cXProtocolRx::onX_Error ( HRESULT  hResRet,
const cVariant vVal 
)
protectedpure virtual

◆ onXReq_Invoke()

HRESULT GrayLib::cXProtocolRx::onXReq_Invoke ( cXObject pObj,
const cScriptableMethod pMethod,
const cVariant vArgs,
OUT cVariant vValRet 
)
protectedvirtual

XPROTO_Invoke|XPROTO_Request Server or Client is calling some method on my pObj. override this virtual

Note
ASSUME cScriptContext is already set if needed (server only)

◆ onXReq_InvokeN()

HRESULT GrayLib::cXProtocolRx::onXReq_InvokeN ( UID_t  uidLastRx,
const ATOMCHAR_t pszMethodName,
ATOMCODE_t  nMethodName,
const cVariant vArgs 
)
protectedvirtual

XPROTO_InvokeN|XPROTO_Request Server or Client is calling some method on some object here. resolve this. nPropName or pszMethodName will be set.

◆ onXSet_File()

HRESULT GrayLib::cXProtocolRx::onXSet_File ( const FILECHAR_t pszReqName,
size_t  dwTotalLen 
)
protectedvirtual

XPROTO_File I am getting a file or part of a file. Override this at a higher level to decide if this is OK. Translate the req name to the local name / path.

  • pszSetFileName = the server side file i am getting. (and probably requested) ASSUME this is not a full path. The client has no business knowing the servvers full paths.
    Returns
    S_FALSE = more to go. S_OK = done.

◆ onXSet_Prop()

HRESULT GrayLib::cXProtocolRx::onXSet_Prop ( cXObject pObj,
const cScriptableProp pProp,
const cVariant vVal 
)
protectedvirtual

XPROTO_Prop someone sent me a single prop. Do something with the data i got. override this virtual.

Note
ASSUME cScriptContext is already set if needed (server only)

◆ onXSet_PropN()

HRESULT GrayLib::cXProtocolRx::onXSet_PropN ( UID_t  uidLastRx,
const ATOMCHAR_t pszPropName,
ATOMCODE_t  nPropName,
const cVariant vVal 
)
protectedvirtual

XPROTO_PropN client is setting a prop on the server by name or hashcode. or server response to client request for a property

◆ ProcessStreamPacket()

HRESULT GrayLib::cXProtocolRx::ProcessStreamPacket ( )
protectedvirtual

Process get_StreamRx() for one single message.

Returns
<0 = error. HRESULT_WIN32_C(ERROR_IO_INCOMPLETE) = not complete message. S_OK = processed full message.

Reimplemented in GrayLib::cXProtocolServerStream.

◆ ProcessStreamRxMsg()

virtual HRESULT GrayLib::cXProtocolRx::ProcessStreamRxMsg ( )
protectedpure virtual

◆ ReadUID()

HRESULT GrayLib::cXProtocolRx::ReadUID ( )
protected

Member Data Documentation

◆ m_bInterfaceIDUnk

SCRIPTINTERFACEID_t GrayLib::cXProtocolRx::m_bInterfaceIDUnk
protected

An interface received that I don't understand (yet)! client only.

◆ m_bMsgReading

XPROTO_t GrayLib::cXProtocolRx::m_bMsgReading
protected

We are in the process of reading/dispatching a message.

◆ m_bMsgReadPrev

XPROTO_t GrayLib::cXProtocolRx::m_bMsgReadPrev
protected

Last message i got and understood. for debug.

◆ m_iMsgNumRx

int GrayLib::cXProtocolRx::m_iMsgNumRx
protected

Count the messages we received.

◆ m_pStreamRx

cStreamInput* GrayLib::cXProtocolRx::m_pStreamRx
protected

Where to RX from.

◆ m_rBase

cXProtocolBase& GrayLib::cXProtocolRx::m_rBase
protected

Input stream.

My parent. dumb pointer.

◆ m_uidLastRx

UID_t GrayLib::cXProtocolRx::m_uidLastRx
protected

Last UID sent from client. ( be careful order of messages does not change!)


The documentation for this class was generated from the following files: