@@ -108,36 +108,24 @@ class MODEL_EXPORT CDataGatherer {
108
108
using TSizeUInt64Pr = std::pair<std::size_t , uint64_t >;
109
109
using TSizeUInt64PrVec = std::vector<TSizeUInt64Pr>;
110
110
using TFeatureVec = model_t ::TFeatureVec;
111
- using TFeatureVecCItr = TFeatureVec::const_iterator;
112
111
using TSizeSizePr = std::pair<std::size_t , std::size_t >;
113
112
using TSizeSizePrUInt64Pr = std::pair<TSizeSizePr, uint64_t >;
114
113
using TSizeSizePrUInt64PrVec = std::vector<TSizeSizePrUInt64Pr>;
115
114
using TSizeSizePrUInt64UMap = boost::unordered_map<TSizeSizePr, uint64_t >;
116
- using TSizeSizePrUInt64UMapItr = TSizeSizePrUInt64UMap::iterator;
117
- using TSizeSizePrUInt64UMapCItr = TSizeSizePrUInt64UMap::const_iterator;
118
115
using TSizeSizePrUInt64UMapQueue = CBucketQueue<TSizeSizePrUInt64UMap>;
119
- using TSizeSizePrUInt64UMapQueueItr = TSizeSizePrUInt64UMapQueue::iterator;
120
- using TSizeSizePrUInt64UMapQueueCItr = TSizeSizePrUInt64UMapQueue::const_iterator;
121
- using TSizeSizePrUInt64UMapQueueCRItr = TSizeSizePrUInt64UMapQueue::const_reverse_iterator;
122
116
using TSizeSizePrStoredStringPtrPrUInt64UMap = CBucketGatherer::TSizeSizePrStoredStringPtrPrUInt64UMap;
123
- using TSizeSizePrStoredStringPtrPrUInt64UMapCItr =
124
- TSizeSizePrStoredStringPtrPrUInt64UMap::const_iterator;
125
- using TSizeSizePrStoredStringPtrPrUInt64UMapItr =
126
- TSizeSizePrStoredStringPtrPrUInt64UMap::iterator;
127
117
using TSizeSizePrStoredStringPtrPrUInt64UMapVec =
128
118
std::vector<TSizeSizePrStoredStringPtrPrUInt64UMap>;
129
119
using TSizeSizePrStoredStringPtrPrUInt64UMapVecQueue =
130
120
CBucketQueue<TSizeSizePrStoredStringPtrPrUInt64UMapVec>;
131
121
using TSearchKeyCRef = boost::reference_wrapper<const CSearchKey>;
132
- using TBucketGathererPVec = std::vector<CBucketGatherer*>;
133
- using TBucketGathererPVecItr = TBucketGathererPVec::iterator;
134
- using TBucketGathererPVecCItr = TBucketGathererPVec::const_iterator;
122
+ using TBucketGathererPtr = std::unique_ptr<CBucketGatherer>;
123
+ using TBucketGathererPtrVec = std::vector<TBucketGathererPtr>;
135
124
using TFeatureAnyPr = std::pair<model_t ::EFeature, boost::any>;
136
125
using TFeatureAnyPrVec = std::vector<TFeatureAnyPr>;
137
126
using TMetricCategoryVec = std::vector<model_t ::EMetricCategory>;
138
- using TSampleCountsPtr = std::shared_ptr <CSampleCounts>;
127
+ using TSampleCountsPtr = std::unique_ptr <CSampleCounts>;
139
128
using TTimeVec = std::vector<core_t ::TTime>;
140
- using TTimeVecCItr = TTimeVec::const_iterator;
141
129
142
130
public:
143
131
// ! The summary count indicating an explicit null record.
@@ -161,8 +149,6 @@ class MODEL_EXPORT CDataGatherer {
161
149
// ! \param[in] modelParams The global configuration parameters.
162
150
// ! \param[in] summaryCountFieldName If \p summaryMode is E_Manual
163
151
// ! then this is the name of the field holding the summary count.
164
- // ! \param[in] partitionFieldName The name of the field which splits
165
- // ! the data.
166
152
// ! \param[in] partitionFieldValue The value of the field which splits
167
153
// ! the data.
168
154
// ! \param[in] personFieldName The name of the field which identifies
@@ -173,8 +159,6 @@ class MODEL_EXPORT CDataGatherer {
173
159
// ! the metric values.
174
160
// ! \param[in] influenceFieldNames The field names for which we will
175
161
// ! compute influences.
176
- // ! \param[in] useNull If true the gatherer will process missing
177
- // ! person and attribute field values (assuming they are empty).
178
162
// ! \param[in] key The key of the search for which to gatherer data.
179
163
// ! \param[in] features The features of the data to model.
180
164
// ! \param[in] startTime The start of the time interval for which
@@ -187,13 +171,11 @@ class MODEL_EXPORT CDataGatherer {
187
171
model_t ::ESummaryMode summaryMode,
188
172
const SModelParams& modelParams,
189
173
const std::string& summaryCountFieldName,
190
- const std::string& partitionFieldName,
191
174
const std::string& partitionFieldValue,
192
175
const std::string& personFieldName,
193
176
const std::string& attributeFieldName,
194
177
const std::string& valueFieldName,
195
178
const TStrVec& influenceFieldNames,
196
- bool useNull,
197
179
const CSearchKey& key,
198
180
const TFeatureVec& features,
199
181
core_t ::TTime startTime,
@@ -204,13 +186,11 @@ class MODEL_EXPORT CDataGatherer {
204
186
model_t ::ESummaryMode summaryMode,
205
187
const SModelParams& modelParams,
206
188
const std::string& summaryCountFieldName,
207
- const std::string& partitionFieldName,
208
189
const std::string& partitionFieldValue,
209
190
const std::string& personFieldName,
210
191
const std::string& attributeFieldName,
211
192
const std::string& valueFieldName,
212
193
const TStrVec& influenceFieldNames,
213
- bool useNull,
214
194
const CSearchKey& key,
215
195
core::CStateRestoreTraverser& traverser);
216
196
@@ -220,8 +200,9 @@ class MODEL_EXPORT CDataGatherer {
220
200
// ! redundant except to create a signature that will not be mistaken for
221
201
// ! a general purpose copy constructor.
222
202
CDataGatherer (bool isForPersistence, const CDataGatherer& other);
223
-
224
203
~CDataGatherer ();
204
+ CDataGatherer (const CDataGatherer&) = delete ;
205
+ CDataGatherer& operator =(const CDataGatherer&) = delete ;
225
206
// @}
226
207
227
208
// ! \name Persistence
@@ -546,7 +527,7 @@ class MODEL_EXPORT CDataGatherer {
546
527
void resetSampleCount (std::size_t id);
547
528
548
529
// ! Get the sample counts.
549
- TSampleCountsPtr sampleCounts () const ;
530
+ const TSampleCountsPtr& sampleCounts () const ;
550
531
// @}
551
532
552
533
// ! \name Time
@@ -759,7 +740,7 @@ class MODEL_EXPORT CDataGatherer {
759
740
760
741
// ! The collection of bucket gatherers which contain the bucket-specific
761
742
// ! metrics and counts.
762
- TBucketGathererPVec m_Gatherers;
743
+ TBucketGathererPtrVec m_Gatherers;
763
744
764
745
// ! Indicates whether the data being gathered are already summarized
765
746
// ! by an external aggregation process.
@@ -768,15 +749,12 @@ class MODEL_EXPORT CDataGatherer {
768
749
// ! The global configuration parameters.
769
750
TModelParamsCRef m_Params;
770
751
771
- // ! The partition field name or an empty string if there isn't one .
772
- std::string m_PartitionFieldName ;
752
+ // ! The key of the search for which data is being gathered .
753
+ TSearchKeyCRef m_SearchKey ;
773
754
774
755
// ! The value of the partition field for this detector.
775
756
core::CStoredStringPtr m_PartitionFieldValue;
776
757
777
- // ! The key of the search for which data is being gathered.
778
- TSearchKeyCRef m_SearchKey;
779
-
780
758
// ! A registry where person names are mapped to unique IDs.
781
759
CDynamicStringIdRegistry m_PeopleRegistry;
782
760
0 commit comments