summaryrefslogtreecommitdiffstats
path: root/public/sdk/inc/cluster.h
blob: c715d92de9d4ae2125d711367e69cd47a6182543 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
//+-------------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright (C) Microsoft Corporation, 1994 - 1994.
//
//  File:       cluster.h
//
//  Contents:   Temporary interfaces for clustering.
//
//  History:    14 Feb 1994	Alanw	Created
//
//  Notes:      These are temporary for the purpose of integrating
//		clustering with the Explorer until such time as the
//		real interface are available via the DNA table
//		implementation.
//
//--------------------------------------------------------------------------

#if !defined( __CLUSTER_H__ )
#define __CLUSTER_H__

#include <query.h>

//
//  Structure definitions used with the CluStartClustering API
//


#ifndef WEIGHTEDPROPID_DEFINED
#define WEIGHTEDPROPID_DEFINED

struct WEIGHTEDPROPID {
	PROPID	 Id;
	unsigned Weight;		// weight of this property
};

#ifndef __cplusplus
typedef	struct WEIGHTEDPROPID	WEIGHTEDPROPID;
#endif	// ndef __cplusplus

struct WEIGHTEDPROPIDLIST {
	unsigned cProps;
//  [sizeis (cProps)]
	WEIGHTEDPROPID* paProps;
};


#ifndef __cplusplus
typedef	struct WEIGHTEDPROPIDLIST	WEIGHTEDPROPIDLIST;
#endif	// ndef __cplusplus
#endif	// WEIGHTEDPROPID_DEFINED



#ifdef __cplusplus

//+-------------------------------------------------------------------------
//
//  Class:      CClustering
//
//  Purpose:    Virtual base class for clustering.
//
//--------------------------------------------------------------------------

class CClustering
{
public:
    virtual ~CClustering();

    //
    // Temporarily stop the clustering process.  Let us say the
    // clustering algorithm intended to do 6 iterations and was in the middle
    // of the third iteration when the the pause command was issued.
    // This command will discontinue the third, fourth, fifth, and the sixth
    // iterations.  Clustering can be resumed by the function given below.
    //
    virtual NTSTATUS PauseClustering() = 0;

    //
    // Perform some more iterations.  Other pending iterations will
    // be cancelled.
    //
    virtual NTSTATUS ResumeClustering(ULONG iExtraIterations) = 0;

    //
    //  Perform up to current limit of iterations
    //
    virtual NTSTATUS ResumeClustering() = 0;
};

#else	// __cplusplus
typedef	VOID*			CClustering;
#endif	// __cplusplus



//
//  APIs for clustering
//

#ifdef __cplusplus
extern "C" {
#endif	// __cplusplus


//+-------------------------------------------------------------------------
//
//  Function:	CluStartClustering, public
//
//  Synopsis:	This function will get the clustering process started,
//		and return a CClustTable through which it can be controlled.
//
//  Arguments:	[pITable] -- the ITable to be clustered
//		[hEvent] -- a handle to an event on which important state
//			changes are signalled.
//		[pPropidList] -- the properties to be clustered; prop-ids
//			are column indexes in this prototype.
//		[NumberOfClusters] -- the desired number of clusters
//		[MaxClusteringTime] -- maximum execution time
//		[MaxIterations] -- maximum number of iterations
//		[ppClustTable] -- on return the CClustTable which controls
//			the clustering.
//
//  Returns:	NTSTATUS - result of the operation.  If successful, clustering
//			may be going on asynchronously.
//
//  Notes:	Temporary scaffolding code.  This will be replaced by the
//			official DNA interface ICategorize someday
//
//--------------------------------------------------------------------------

NTSTATUS CluStartClustering(
  /*[in] */	ITable* pITable,
  /*[in] */	HANDLE hEvent,
  /*[in] */	WEIGHTEDPROPIDLIST* pPropidList,
  /*[in] */	unsigned NumberOfClusters,
  /*[in] */	unsigned MaxClusteringTime,
  /*[in] */	unsigned MaxIterations,
  /*[out] */	CClustering** ppClustTable
);

//+-------------------------------------------------------------------------
//
//  Function:   CluCreateClusteringTable,public
//
//  Synopsis:   Create an ITable for a clustering given a CClustTable
//		pointer returned by CluStartClustering.
//
//  Arguments:  [pClustTable] -- the clustering table object as
//				returned from CluStartClustering.
//		[ppITable] -- a pointer to the location where the
//				clustering ITable is returned.
//
//  Returns:    HRESULT - success indication
//
//  Notes:	Temporary scaffolding code.  This will be replaced by the
//			official DNA interface ICategorize someday
//
//--------------------------------------------------------------------------

NTSTATUS CluCreateClusteringTable(
  /*[in] */	CClustering* pClustTable,
  /*[out] */	ITable** ppITable
);


//+-------------------------------------------------------------------------
//
//  Function:   CluCreateClusterSubTable,public
//
//  Synopsis:   Create an ITable for a sub-cluster given a CClustTable
//		pointer returned by CluStartClustering.
//
//  Arguments:  [pClustTable] -- the clustering table object as
//				returned from CluStartClustering.
//		[iCluster] -- cluster number of sub-table.
//		[ppITable] -- a pointer to the location where the
//				clustering ITable is returned.
//
//  Returns:    HRESULT - success indication
//
//  Notes:	Temporary scaffolding code.  This will be replaced by the
//			official DNA interface ICategorize someday
//
//--------------------------------------------------------------------------

NTSTATUS CluCreateClusterSubTable(
  /*[in] */	CClustering* pClustTable,
  /*[in] */	unsigned iCluster,
  /*[out] */	ITable** ppITable
);

#ifdef __cplusplus
};
#endif	// __cplusplus



#endif // __CLUSTER_H__