init

The init method initializes the RiCOSMessageQueue object.

Signature
RiCBoolean RiCOSMessageQueue_init(
   RiCOSMessageQueue *const me, RiCBoolean shouldGrow,
   int initSize);
Parameters
me

Specifies the RiCOSMessageQueue object to initialize.

shouldGrow

Determines whether the queue should be of fixed size (RiCFALSE) or able to expand as needed (RiCTRUE).

initSize

Specifies the initial size of the queue. The default message queue size is set by the variable RiCOSDefaultMessageQueueSize. You can override the default value by passing a different value when you create the message queue.

The maximum length of the message queue is operating system- and implementation-dependent. It is usually set in the adapter for a particular operating system.

Returns

The method returns RiCTRUE if successful.

Example
RiCBoolean RiCOSMessageQueue_init(
   RiCOSMessageQueue * const me, RiCBoolean shouldGrow,
   int initSize)
{
   if (me == NULL) return RiCFALSE;

   if (initSize < 0) initSize =    
      RiCOSDefaultMessageQueueSize;
      me->m_State = noData;
      me->hVxMQ = msgQCreate(initSize, sizeof(void*),
         MSG_Q_FIFO);
      return RiCTRUE;
}

Feedback