INtime SDK Help
CILLMbx
This topic contains these sections:

The CILLMbx class encapsulates the low level RT mailbox object; it allows sending and receiving messages. The CILLMbx class is typically used as it is.

Class members

Constructor

Destructor

Create

Send

SendPriority

Receive

The following member variables are only available to the members of the class and its derived classes:

KNHANDLE m_hLLObject; PVOID m_pArea; DWORD m_dwMsgSize;

The class member m_hRTObject is either NULL_RTHANDLE (not attached) or BAD_RTHANDLE (attached).

Inherited functions

The Lookup and Attach functions are useless as they operate on RTHANDLEs.

CILLMbx::Constructor

The constructor has no arguments. It creates an unattached object.

CILLMbx::Destructor

If the object is attached, the destructor detaches it; then it destroys the object.

CILLMbx::Create

If the object is already attached, it is first detached. Then this call creates a low level RT mailbox object and attaches it to the object.

Syntax

DWORD CILLMbx::Create(
    DWORD dwMsgSize, 
    DWORD dwQueueLength,
    BOOLEAN bPrioQ, 
    BOOLEAN bPrioSlot
);

Parameters

dwMsgSize
Specifies the maximum size of a message.
dwQueueLength
Specifies the maximum number of queued messages.
bPrioQ
Indicates whether threads waiting for a message will be queued in priority order (TRUE) or FIFO (FALSE); if omitted, FALSE is used.
bPrioSlot
Indicates if a slot is reserved for a priority message; if omitted, FALSE is assumed. The result is a status indicating success or failure.

Status

E_OK
No exceptional conditions occurred.
E_MEM
Creating the space for the object requires more memory than the current process owns.

CILLMbx::Send

With this call a message is sent to the low level mailbox.

Syntax

DWORD CILLMbx::Send(
    PVOID pv, 
    DWORD dwLen
);

Parameters

pv
Points to a buffer.
dwLen
Specifies the number of bytes to be sent; dwLen should not exceed the maximum message size at creation time. The result is a status indicating success or failure.

Status

E_OK
No exceptional conditions occurred.
E_PARAM
The length is less than 1 or greater than the size specified in Create.
E_KN_LIMIT_EXCEEDED
The mailbox was full.
E_EXIST
The object is not attached.

CILLMbx::Send Priority

With this call a message is sent to the low level mailbox and placed in the reserved priority slot.

Syntax

DWORD CILLMbx::SendPriority(
    PVOID pv, 
    DWORD dwLen
);

Parameters

pv
Points to a buffer.
dwLen
Specifies the number of bytes to be sent; dwLen should not exceed the maximum message size at creation time. The result is a status indicating success or failure.

pv ,

Status

E_OK
No exceptional conditions occurred.
E_PARAM
The length is less than 1 or greater than the size specified in Create.
E_KN_LIMIT_EXCEEDED
The mailbox was full.
E_EXIST
The object is not attached.

CILLMbx::Receive

This call puts the thread in a sleep state until a message arrives, or until a timeout occurs.

Syntax

DWORD CILLMbx::Receive(
    PVOID pv, 
    DWORD dwMax, 
    DWORD dwUsecs
);

Parameters

pv
Points to a buffer to receive the message.
dwMax
Indicates the size of the buffer in bytes.
dwUsecs
Defines how long the thread will wait (in usecs) and may be omitted (meaning WAIT_FOREVER). The result is the number of bytes received, or zero in case of error.

Status

E_OK
No exceptional conditions occurred.
E_PARAM
The size of the buffer is less than 1.
E_KN_TIME_OUT
No message was available during the waiting period.
E_KN_NONEXIST
The mailbox was deleted while the thread was waiting.
E_EXIST
The object is not attached.

CILLSemaphore

The CILLSemaphore class encapsulates the low level RT semaphore object; it allows sending and receiving units, which may represent any application dependent resource. The CILLSemaphore class is typically used as it is.

Class members

Constructor

Destructor

Create

Release

Wait

The following member variables are only available to the members of the class and its derived classes:

KNHANDLE m_hLLObject; PVOID m_pArea;

The class member m_hRTObject is either NULL_RTHANDLE (not attached) or BAD_RTHANDLE (attached).

Inherited functions

The Lookup and Attach functions are useless as they operate on RTHANDLEs.

 

See Also

Mailboxes