Source code of Windows XP (NT5)
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.

203 lines
5.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994-1999.
  5. //
  6. // File: cluster.h
  7. //
  8. // Contents: Temporary interfaces for clustering.
  9. //
  10. // History: 14 Feb 1994 Alanw Created
  11. //
  12. // Notes: These are temporary for the purpose of integrating
  13. // clustering with the Explorer until such time as the
  14. // real interface are available via the DNA table
  15. // implementation.
  16. //
  17. //--------------------------------------------------------------------------
  18. #if !defined( __CLUSTER_H__ )
  19. #define __CLUSTER_H__
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif
  23. #include <query.h>
  24. //
  25. // Structure definitions used with the CluStartClustering API
  26. //
  27. #ifndef WEIGHTEDPROPID_DEFINED
  28. #define WEIGHTEDPROPID_DEFINED
  29. struct WEIGHTEDPROPID {
  30. PROPID Id;
  31. unsigned Weight; // weight of this property
  32. };
  33. #ifndef __cplusplus
  34. typedef struct WEIGHTEDPROPID WEIGHTEDPROPID;
  35. #endif // ndef __cplusplus
  36. struct WEIGHTEDPROPIDLIST {
  37. unsigned cProps;
  38. // [sizeis (cProps)]
  39. WEIGHTEDPROPID* paProps;
  40. };
  41. #ifndef __cplusplus
  42. typedef struct WEIGHTEDPROPIDLIST WEIGHTEDPROPIDLIST;
  43. #endif // ndef __cplusplus
  44. #endif // WEIGHTEDPROPID_DEFINED
  45. #ifdef __cplusplus
  46. //+-------------------------------------------------------------------------
  47. //
  48. // Class: CClustering
  49. //
  50. // Purpose: Virtual base class for clustering.
  51. //
  52. //--------------------------------------------------------------------------
  53. class CClustering
  54. {
  55. public:
  56. virtual ~CClustering();
  57. //
  58. // Temporarily stop the clustering process. Let us say the
  59. // clustering algorithm intended to do 6 iterations and was in the middle
  60. // of the third iteration when the the pause command was issued.
  61. // This command will discontinue the third, fourth, fifth, and the sixth
  62. // iterations. Clustering can be resumed by the function given below.
  63. //
  64. virtual NTSTATUS PauseClustering() = 0;
  65. //
  66. // Perform some more iterations. Other pending iterations will
  67. // be cancelled.
  68. //
  69. virtual NTSTATUS ResumeClustering(ULONG iExtraIterations) = 0;
  70. //
  71. // Perform up to current limit of iterations
  72. //
  73. virtual NTSTATUS ResumeClustering() = 0;
  74. };
  75. #else // __cplusplus
  76. typedef VOID* CClustering;
  77. #endif // __cplusplus
  78. //
  79. // APIs for clustering
  80. //
  81. #ifdef __cplusplus
  82. extern "C" {
  83. #endif // __cplusplus
  84. //+-------------------------------------------------------------------------
  85. //
  86. // Function: CluStartClustering, public
  87. //
  88. // Synopsis: This function will get the clustering process started,
  89. // and return a CClustTable through which it can be controlled.
  90. //
  91. // Arguments: [pITable] -- the ITable to be clustered
  92. // [hEvent] -- a handle to an event on which important state
  93. // changes are signalled.
  94. // [pPropidList] -- the properties to be clustered; prop-ids
  95. // are column indexes in this prototype.
  96. // [NumberOfClusters] -- the desired number of clusters
  97. // [MaxClusteringTime] -- maximum execution time
  98. // [MaxIterations] -- maximum number of iterations
  99. // [ppClustTable] -- on return the CClustTable which controls
  100. // the clustering.
  101. //
  102. // Returns: NTSTATUS - result of the operation. If successful, clustering
  103. // may be going on asynchronously.
  104. //
  105. // Notes: Temporary scaffolding code. This will be replaced by the
  106. // official DNA interface ICategorize someday
  107. //
  108. //--------------------------------------------------------------------------
  109. NTSTATUS CluStartClustering(
  110. /*[in] */ ITable* pITable,
  111. /*[in] */ HANDLE hEvent,
  112. /*[in] */ WEIGHTEDPROPIDLIST* pPropidList,
  113. /*[in] */ unsigned NumberOfClusters,
  114. /*[in] */ unsigned MaxClusteringTime,
  115. /*[in] */ unsigned MaxIterations,
  116. /*[out] */ CClustering** ppClustTable
  117. );
  118. //+-------------------------------------------------------------------------
  119. //
  120. // Function: CluCreateClusteringTable,public
  121. //
  122. // Synopsis: Create an ITable for a clustering given a CClustTable
  123. // pointer returned by CluStartClustering.
  124. //
  125. // Arguments: [pClustTable] -- the clustering table object as
  126. // returned from CluStartClustering.
  127. // [ppITable] -- a pointer to the location where the
  128. // clustering ITable is returned.
  129. //
  130. // Returns: HRESULT - success indication
  131. //
  132. // Notes: Temporary scaffolding code. This will be replaced by the
  133. // official DNA interface ICategorize someday
  134. //
  135. //--------------------------------------------------------------------------
  136. NTSTATUS CluCreateClusteringTable(
  137. /*[in] */ CClustering* pClustTable,
  138. /*[out] */ ITable** ppITable
  139. );
  140. //+-------------------------------------------------------------------------
  141. //
  142. // Function: CluCreateClusterSubTable,public
  143. //
  144. // Synopsis: Create an ITable for a sub-cluster given a CClustTable
  145. // pointer returned by CluStartClustering.
  146. //
  147. // Arguments: [pClustTable] -- the clustering table object as
  148. // returned from CluStartClustering.
  149. // [iCluster] -- cluster number of sub-table.
  150. // [ppITable] -- a pointer to the location where the
  151. // clustering ITable is returned.
  152. //
  153. // Returns: HRESULT - success indication
  154. //
  155. // Notes: Temporary scaffolding code. This will be replaced by the
  156. // official DNA interface ICategorize someday
  157. //
  158. //--------------------------------------------------------------------------
  159. NTSTATUS CluCreateClusterSubTable(
  160. /*[in] */ CClustering* pClustTable,
  161. /*[in] */ unsigned iCluster,
  162. /*[out] */ ITable** ppITable
  163. );
  164. #ifdef __cplusplus
  165. };
  166. #endif // __cplusplus
  167. #endif // __CLUSTER_H__