qClass.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* qClass.h - queue object class header */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02c,15oct93,cd   added #ifndef _ASMLANGUAGE.
  7. 02b,22sep92,rrr  added support for c++
  8. 02a,04jul92,jcf  cleaned up.
  9. 01g,26may92,rrr  the tree shuffle
  10. 01f,04oct91,rrr  passed through the ansification filter
  11.   -changed copyright notice
  12. 01e,06apr91,gae  added NOMANUAL to avoid fooling mangen.
  13. 01d,05oct90,shl  added copyright notice.
  14.                  made #endif ANSI style.
  15. 01c,05jul90,jcf   added calibrate routine.
  16. 01b,26jun90,jcf   remove qClass/qType definitions of multi-way queues
  17.   added Q_CLASS_ID.
  18. 01a,21oct89,jcf   written.
  19. */
  20. #ifndef __INCqClassh
  21. #define __INCqClassh
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #include "vxWorks.h"
  26. #ifndef _ASMLANGUAGE
  27. /* HIDDEN */
  28. typedef struct q_class /* Q_CLASS */
  29.     {
  30.     FUNCPTR createRtn; /* create and initialize a queue */
  31.     FUNCPTR initRtn; /* initialize a queue */
  32.     FUNCPTR deleteRtn; /* delete and terminate a queue */
  33.     FUNCPTR terminateRtn; /* terminate a queue */
  34.     FUNCPTR putRtn; /* insert a node into q with insertion key */
  35.     FUNCPTR getRtn; /* return and remove lead node routine */
  36.     FUNCPTR removeRtn; /* remove routine */
  37.     FUNCPTR resortRtn; /* resort node to new priority */
  38.     FUNCPTR advanceRtn; /* advance queue by one tick routine */
  39.     FUNCPTR getExpiredRtn; /* return and remove an expired Q_NODE */
  40.     FUNCPTR keyRtn; /* return insertion key of node */
  41.     FUNCPTR calibrateRtn; /* calibrate every node in queue by an offset */
  42.     FUNCPTR infoRtn; /* return array of nodes in queue */
  43.     FUNCPTR eachRtn; /* call a user routine for each node in queue */
  44.     struct q_class *valid; /* valid == pointer to queue class */
  45.     } Q_CLASS;
  46. typedef Q_CLASS *Q_CLASS_ID; /* Q_CLASS_ID */
  47. /* END HIDDEN */
  48. /*******************************************************************************
  49. *
  50. * Q_CLASS_VERIFY - check the validity of an queue class pointer
  51. *
  52. * This macro verifies the existence of the specified queue class by comparing
  53. * the queue classes valid field to the pointer to the queue class.
  54. *
  55. * RETURNS: OK or ERROR if invalid class pointer
  56. *
  57. * NOMANUAL
  58. */
  59. #define Q_CLASS_VERIFY(pQClass)
  60.     (
  61.     (((Q_CLASS *)(pQClass))->valid == (Q_CLASS *) pQClass) ?
  62.     OK
  63. :
  64.     ERROR
  65.     )
  66. #endif /* _ASMLANGUAGE */
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif /* __INCqClassh */