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

#include <cXProtocol.h>

Inheritance diagram for GrayLib::cXProtocolTx:
GrayLib::cXProtocolClient GrayLib::cXProtocolServerTx GrayLib::cXProtocolServerStream GrayLib::cXProtocolServerStreamImpl

Protected Member Functions

void InitTx ()
 
HRESULT Send_MsgPropName (const ATOMCHAR_t *pszPropName)
 
cStreamOutputget_StreamTx () const
 
 cXProtocolTx (cXProtocolBase &rBase, cStreamOutput *pStreamTx)
 
virtual ~cXProtocolTx ()
 
bool IsTxMsgBuilding () const
 
HRESULT Send_MsgHeader (XPROTO_t bMsg)
 
HRESULT Send_MsgHeaderUID (XPROTO_t bMsg, UID_t uid)
 
void Send_MsgEnd ()
 
HRESULT Send_Error (HRESULT hResRet, const cVariant &vVal)
 
HRESULT Send_PropN (UID_t uid, const ATOMCHAR_t *pszPropName, const cVariant &vVal)
 
HRESULT Send_PropN (cXObject *pObj, const ATOMCHAR_t *pszPropName, const cVariant &vValRet)
 
HRESULT Send_PropN (cXObject *pObj, const cScriptableProp *pProp, const cVariant &vValRet)
 
HRESULT Request_InvokeN (UID_t uid, const ATOMCHAR_t *pszPropName, const cVariant &vArgs)
 
HRESULT Request_InvokeN (UID_t uid, const ATOMCHAR_t *pszPropName)
 
HRESULT Request_InvokeN (cXObject *pObj, const ATOMCHAR_t *pszPropName, const cVariant &vArgs)
 
HRESULT Request_InvokeN (cXObject *pObj, const ATOMCHAR_t *pszPropName)
 
HRESULT Request_InvokeN (cXObject *pObj, const cScriptableMethod *pMethod, const cVariant &vArgs)
 
HRESULT Send_FileChecked (const FILECHAR_t *pszSrcPath, const FILECHAR_t *pszDestName)
 
HRESULT Send_File (const FILECHAR_t *pszSrcPath, const FILECHAR_t *pszDestName, FILE_SIZE_t nOffsetStart, FILE_SIZE_t nSize)
 
HRESULT Send_FileNext ()
 

Protected Attributes

cXProtocolBasem_rBase
 My parent. dumb pointer. More...
 
cStreamOutputm_pStreamTx
 Where to TX to. More...
 
XPROTO_t m_bMsgBuilding
 We are in the process of building a message. not called Send_MsgEnd() yet. More...
 
bool m_bFileSending
 Must call Send_FileNext() until done. More...
 
int m_iMsgNumTx
 Count the messages we transmit. More...
 
UID_t m_uidLastTx
 Last UID i sent. Periodically resend this just in case the other side gets out of sync ? More...
 

Friends

class cXProtocolServerTx
 

Detailed Description

Build message(s) out to a stream. Sent from client or server side. both directions.

Constructor & Destructor Documentation

◆ cXProtocolTx()

GrayLib::cXProtocolTx::cXProtocolTx ( cXProtocolBase rBase,
cStreamOutput pStreamTx 
)
protected

◆ ~cXProtocolTx()

GrayLib::cXProtocolTx::~cXProtocolTx ( )
protectedvirtual

Member Function Documentation

◆ get_StreamTx()

cStreamOutput& GrayLib::cXProtocolTx::get_StreamTx ( ) const
inlineprotected

◆ InitTx()

void GrayLib::cXProtocolTx::InitTx ( )
protected

State info.

◆ IsTxMsgBuilding()

bool GrayLib::cXProtocolTx::IsTxMsgBuilding ( ) const
inlineprotected

◆ Request_InvokeN() [1/5]

HRESULT GrayLib::cXProtocolTx::Request_InvokeN ( cXObject pObj,
const ATOMCHAR_t pszPropName 
)
protected

XPROTO_InvokeN|XPROTO_Request With no args. Server sending a method call to a client side object.

◆ Request_InvokeN() [2/5]

HRESULT GrayLib::cXProtocolTx::Request_InvokeN ( cXObject pObj,
const ATOMCHAR_t pszPropName,
const cVariant vArgs 
)
protected

XPROTO_InvokeN|XPROTO_Request Server sending a method call to a client side object.

◆ Request_InvokeN() [3/5]

HRESULT GrayLib::cXProtocolTx::Request_InvokeN ( cXObject pObj,
const cScriptableMethod pMethod,
const cVariant vArgs 
)
protected

XPROTO_InvokeN|XPROTO_Request Server sending a method call to a client side object.

◆ Request_InvokeN() [4/5]

HRESULT GrayLib::cXProtocolTx::Request_InvokeN ( UID_t  uid,
const ATOMCHAR_t pszPropName 
)
protected

XPROTO_InvokeN|XPROTO_Request With no args. Server sending a method call to a client side object.

◆ Request_InvokeN() [5/5]

HRESULT GrayLib::cXProtocolTx::Request_InvokeN ( UID_t  uid,
const ATOMCHAR_t pszPropName,
const cVariant vArgs 
)
protected

XPROTO_InvokeN|XPROTO_Request Send the Server/Client a method on some object. Or invoke a method on the other side.

◆ Send_Error()

HRESULT GrayLib::cXProtocolTx::Send_Error ( HRESULT  hResRet,
const cVariant vVal 
)
protected

Send the client an error code. or the client sends the server an error in the XPROTO_File case. Whatever the client sent last caused some error. report it to the client.

◆ Send_File()

HRESULT GrayLib::cXProtocolTx::Send_File ( const FILECHAR_t pszSrcPath,
const FILECHAR_t pszDestName,
FILE_SIZE_t  nOffsetStart,
FILE_SIZE_t  nSize 
)
protected

XPROTO_File Send a file to the server or client. This results in onSet_File() on the cXProtocolRx side.

  • pszSrcPath = local side source name. pszDestName = requester side dest name.
    Note
    requires subsequent calls to Send_FileNext()

◆ Send_FileChecked()

HRESULT GrayLib::cXProtocolTx::Send_FileChecked ( const FILECHAR_t pszSrcPath,
const FILECHAR_t pszDestName 
)
protected

XPROTO_File Send a file to the server or client. opposite of onSet_File()

  • pszSrcPath = local path.
    Note
    requires subsequent calls to Send_FileNext()
    a hacked file request for "COM1:" would kill us if we just used Open() directly!! ASSUME the file exists and has been checked for security.
    Returns
    S_OK = done. S_FALSE = more to go.

◆ Send_FileNext()

HRESULT GrayLib::cXProtocolTx::Send_FileNext ( )
protected

XPROTO_File|XPROTO_NextChunk continue sending the file in chunks. Send only when the socket is ready to send. Send only as much as the output channel can hold.

Returns
S_OK = done writing. S_FALSE = more to go.

◆ Send_MsgEnd()

void GrayLib::cXProtocolTx::Send_MsgEnd ( )
protected

Must be called after Send_MsgHeader

◆ Send_MsgHeader()

HRESULT GrayLib::cXProtocolTx::Send_MsgHeader ( XPROTO_t  bMsg)
protected

We are about to start sending a message. ASSUME will call Send_MsgEnd()

Returns
S_OK = 0 = OK <0 = can't write more yet. HRESULT_WIN32_C(ERROR_WRITE_FAULT) = no room.

◆ Send_MsgHeaderUID()

HRESULT GrayLib::cXProtocolTx::Send_MsgHeaderUID ( XPROTO_t  bMsg,
UID_t  uid 
)
protected

write a message that applies to a UID. ASSUME will call Send_MsgEnd()

◆ Send_MsgPropName()

HRESULT GrayLib::cXProtocolTx::Send_MsgPropName ( const ATOMCHAR_t pszPropName)
protected

Send the prop/method name alone

◆ Send_PropN() [1/3]

HRESULT GrayLib::cXProtocolTx::Send_PropN ( cXObject pObj,
const ATOMCHAR_t pszPropName,
const cVariant vValRet 
)
protected

XPROTO_PropN

◆ Send_PropN() [2/3]

HRESULT GrayLib::cXProtocolTx::Send_PropN ( cXObject pObj,
const cScriptableProp pProp,
const cVariant vValRet 
)
protected

XPROTO_PropN Server sending a prop val to a client side object.

◆ Send_PropN() [3/3]

HRESULT GrayLib::cXProtocolTx::Send_PropN ( UID_t  uid,
const ATOMCHAR_t pszPropName,
const cVariant vVal 
)
protected

XPROTO_PropN Send the Server/client a prop change on some object. Typically used to create an event on my char.

Friends And Related Function Documentation

◆ cXProtocolServerTx

friend class cXProtocolServerTx
friend

Member Data Documentation

◆ m_bFileSending

bool GrayLib::cXProtocolTx::m_bFileSending
protected

Must call Send_FileNext() until done.

◆ m_bMsgBuilding

XPROTO_t GrayLib::cXProtocolTx::m_bMsgBuilding
protected

We are in the process of building a message. not called Send_MsgEnd() yet.

◆ m_iMsgNumTx

int GrayLib::cXProtocolTx::m_iMsgNumTx
protected

Count the messages we transmit.

◆ m_pStreamTx

cStreamOutput* GrayLib::cXProtocolTx::m_pStreamTx
protected

Where to TX to.

◆ m_rBase

cXProtocolBase& GrayLib::cXProtocolTx::m_rBase
protected

My parent. dumb pointer.

◆ m_uidLastTx

UID_t GrayLib::cXProtocolTx::m_uidLastTx
protected

Last UID i sent. Periodically resend this just in case the other side gets out of sync ?


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