Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. Queue.h
  5. Abstract:
  6. Declaration of the CQueue class
  7. Author:
  8. noela 11-04-97
  9. Notes:
  10. Revision History:
  11. --*/
  12. #ifndef __QUEUE_H_
  13. #define __QUEUE_H_
  14. #include "resource.h" // main symbols
  15. class CAgentHandler;
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CQueue
  18. class ATL_NO_VTABLE CQueue :
  19. public CTAPIComObjectRoot<CQueue>,
  20. public IDispatchImpl<ITQueue, &IID_ITQueue, &LIBID_TAPI3Lib>,
  21. public CObjectSafeImpl
  22. {
  23. private:
  24. PWSTR m_szName;
  25. DWORD m_dwHandle;
  26. CAgentHandler * m_pHandler;
  27. BOOL m_bRequiresUpdating;
  28. DWORD m_dwMeasurementPeriod;
  29. DWORD m_dwTotalCallsQueued;
  30. DWORD m_dwCurrentCallsQueued;
  31. DWORD m_dwTotalCallsAdandoned;
  32. DWORD m_dwTotalCallsFlowedIn;
  33. DWORD m_dwTotalCallsFlowedOut;
  34. DWORD m_dwLongestEverWaitTime;
  35. DWORD m_dwCurrentLongestWaitTime;
  36. DWORD m_dwAverageWaitTime;
  37. DWORD m_dwFinalDisposition;
  38. public:
  39. CQueue();
  40. ~CQueue()
  41. {
  42. //DeleteCriticalSection( &m_csDataLock );
  43. }
  44. STDMETHOD(UpdateInfo) ();
  45. STDMETHOD(CheckIfUpToDate) ();
  46. inline DWORD getID() {return m_dwHandle;}
  47. inline void SetRequiresUpdate() {m_bRequiresUpdating = TRUE;}
  48. void FinalRelease();
  49. CAgentHandler * GetAgentHandler() { return m_pHandler; }
  50. DECLARE_MARSHALQI(CQueue)
  51. DECLARE_TRACELOG_CLASS(CQueue)
  52. BEGIN_COM_MAP(CQueue)
  53. COM_INTERFACE_ENTRY(ITQueue)
  54. COM_INTERFACE_ENTRY(IDispatch)
  55. COM_INTERFACE_ENTRY(IObjectSafety)
  56. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  57. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  58. END_COM_MAP()
  59. // ITQueue
  60. public:
  61. STDMETHOD(get_Name)(BSTR * ppName);
  62. STDMETHOD(put_MeasurementPeriod)(long ulPeriod);
  63. STDMETHOD(get_MeasurementPeriod) (long *pulPeriod);
  64. STDMETHOD(get_TotalCallsQueued) (long * pulCalls);
  65. STDMETHOD(get_CurrentCallsQueued) (long * pulCalls);
  66. STDMETHOD(get_TotalCallsAbandoned) (long * pulCalls);
  67. STDMETHOD(get_TotalCallsFlowedIn) (long * pulCalls);
  68. STDMETHOD(get_TotalCallsFlowedOut) (long * pulCalls);
  69. STDMETHOD(get_LongestEverWaitTime) (long * pulWaitTime);
  70. STDMETHOD(get_CurrentLongestWaitTime) (long * pulWaitTime);
  71. STDMETHOD(get_AverageWaitTime) (long * pulWaitTime);
  72. STDMETHOD(get_FinalDisposition) (long * pulCalls);
  73. STDMETHOD(Initialize)
  74. (
  75. DWORD dwQueueID,
  76. PWSTR pszName,
  77. CAgentHandler * pHandler
  78. );
  79. };
  80. /////////////////////////////////////////////////////////////////////////////
  81. // CQueueEvent
  82. class ATL_NO_VTABLE CQueueEvent :
  83. public CTAPIComObjectRoot<CQueueEvent>,
  84. public IDispatchImpl<ITQueueEvent, &IID_ITQueueEvent, &LIBID_TAPI3Lib>,
  85. public CObjectSafeImpl
  86. {
  87. protected:
  88. ACDQUEUE_EVENT m_QueueEvent;
  89. ITQueue * m_pQueue;
  90. public:
  91. CQueueEvent()
  92. {
  93. }
  94. static HRESULT FireEvent(
  95. CQueue * pQueue,
  96. ACDQUEUE_EVENT Event
  97. );
  98. void FinalRelease();
  99. DECLARE_MARSHALQI(CQueueEvent)
  100. DECLARE_TRACELOG_CLASS(CQueueEvent)
  101. BEGIN_COM_MAP(CQueueEvent)
  102. COM_INTERFACE_ENTRY(ITQueueEvent)
  103. COM_INTERFACE_ENTRY(IDispatch)
  104. COM_INTERFACE_ENTRY(IObjectSafety)
  105. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  106. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  107. END_COM_MAP()
  108. // ITQueueEvent
  109. public:
  110. STDMETHOD(get_Event)(ACDQUEUE_EVENT * pEvent);
  111. STDMETHOD(get_Queue)(ITQueue ** ppQueue);
  112. };
  113. #endif //__QUEUE_H_