defs/si_std/queuet.h File Reference

A template file that generates strongly typed queues of user defined types. More...

#include <si_std/queue.h>

Go to the source code of this file.

Defines

#define sm_queueDecl(T)
 A macro that declares a queue containing items of user defined type T.
#define sm_queueImpl(T)
 Macro that implements type-safe wrappers for the generic queue object.


Detailed Description

A template file that generates strongly typed queues of user defined types.

See also:
queue.h

Define Documentation

#define sm_queueDecl (  ) 

Value:

typedef sc_queue T##Queue;\
    typedef sc_queueNode* T##QueueIterator;\
    sc_status T##Queue_construct(T##Queue*,\
                                 s_int32 initialCapacity);\
    sc_status T##Queue_pushBack(T##Queue*, T* pt);\
    sc_status T##Queue_popFront(T##Queue*, T* pt);\
    sc_status T##Queue_destruct(T##Queue* pq);\
    static T* T##QueueIterator_get(T##QueueIterator* it)\
    { return (T*)((*it)+1); }
A macro that declares a queue containing items of user defined type T.

The following new types are declared:

  • TQueue
  • TQueueIterator

Note:
Requires a type T that has the following functions defined:
  • T_constructCopy
  • T_assign
  • T_destruct

#define sm_queueImpl (  ) 

Value:

sc_status T##Queue_construct(T##Queue* q,\
                                 s_int32 c)\
    { \
      static const sc_queueNodeDesc d = { sizeof(T),\
        (sc_queueNode_constructCopy_f)T##_constructCopy,\
        (sc_queueNode_assign_f)T##_assign,\
        (sc_queueNode_destruct_f)T##_destruct }; \
      return sc_queue_construct(q,&d,c); \
    } \
    sc_status T##Queue_pushBack(T##Queue* q, T* v) \
    {  return sc_queue_pushBack(q,v); }\
    sc_status T##Queue_popFront(T##Queue* q, T* v) \
    { return sc_queue_popFront(q,v); }\
    sc_status T##Queue_destruct(T##Queue* q) \
    { return sc_queue_destruct(q); }
Macro that implements type-safe wrappers for the generic queue object.

This would typically appear in the implemenation file for the type T, and implements the functions declared in sm_queueDecl.


doxygen