@@ -108,36 +108,24 @@ class MODEL_EXPORT CDataGatherer {
108108 using TSizeUInt64Pr = std::pair<std::size_t , uint64_t >;
109109 using TSizeUInt64PrVec = std::vector<TSizeUInt64Pr>;
110110 using TFeatureVec = model_t ::TFeatureVec;
111- using TFeatureVecCItr = TFeatureVec::const_iterator;
112111 using TSizeSizePr = std::pair<std::size_t , std::size_t >;
113112 using TSizeSizePrUInt64Pr = std::pair<TSizeSizePr, uint64_t >;
114113 using TSizeSizePrUInt64PrVec = std::vector<TSizeSizePrUInt64Pr>;
115114 using TSizeSizePrUInt64UMap = boost::unordered_map<TSizeSizePr, uint64_t >;
116- using TSizeSizePrUInt64UMapItr = TSizeSizePrUInt64UMap::iterator;
117- using TSizeSizePrUInt64UMapCItr = TSizeSizePrUInt64UMap::const_iterator;
118115 using TSizeSizePrUInt64UMapQueue = CBucketQueue<TSizeSizePrUInt64UMap>;
119- using TSizeSizePrUInt64UMapQueueItr = TSizeSizePrUInt64UMapQueue::iterator;
120- using TSizeSizePrUInt64UMapQueueCItr = TSizeSizePrUInt64UMapQueue::const_iterator;
121- using TSizeSizePrUInt64UMapQueueCRItr = TSizeSizePrUInt64UMapQueue::const_reverse_iterator;
122116 using TSizeSizePrStoredStringPtrPrUInt64UMap = CBucketGatherer::TSizeSizePrStoredStringPtrPrUInt64UMap;
123- using TSizeSizePrStoredStringPtrPrUInt64UMapCItr =
124- TSizeSizePrStoredStringPtrPrUInt64UMap::const_iterator;
125- using TSizeSizePrStoredStringPtrPrUInt64UMapItr =
126- TSizeSizePrStoredStringPtrPrUInt64UMap::iterator;
127117 using TSizeSizePrStoredStringPtrPrUInt64UMapVec =
128118 std::vector<TSizeSizePrStoredStringPtrPrUInt64UMap>;
129119 using TSizeSizePrStoredStringPtrPrUInt64UMapVecQueue =
130120 CBucketQueue<TSizeSizePrStoredStringPtrPrUInt64UMapVec>;
131121 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>;
135124 using TFeatureAnyPr = std::pair<model_t ::EFeature, boost::any>;
136125 using TFeatureAnyPrVec = std::vector<TFeatureAnyPr>;
137126 using TMetricCategoryVec = std::vector<model_t ::EMetricCategory>;
138- using TSampleCountsPtr = std::shared_ptr <CSampleCounts>;
127+ using TSampleCountsPtr = std::unique_ptr <CSampleCounts>;
139128 using TTimeVec = std::vector<core_t ::TTime>;
140- using TTimeVecCItr = TTimeVec::const_iterator;
141129
142130public:
143131 // ! The summary count indicating an explicit null record.
@@ -161,8 +149,6 @@ class MODEL_EXPORT CDataGatherer {
161149 // ! \param[in] modelParams The global configuration parameters.
162150 // ! \param[in] summaryCountFieldName If \p summaryMode is E_Manual
163151 // ! 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.
166152 // ! \param[in] partitionFieldValue The value of the field which splits
167153 // ! the data.
168154 // ! \param[in] personFieldName The name of the field which identifies
@@ -173,8 +159,6 @@ class MODEL_EXPORT CDataGatherer {
173159 // ! the metric values.
174160 // ! \param[in] influenceFieldNames The field names for which we will
175161 // ! compute influences.
176- // ! \param[in] useNull If true the gatherer will process missing
177- // ! person and attribute field values (assuming they are empty).
178162 // ! \param[in] key The key of the search for which to gatherer data.
179163 // ! \param[in] features The features of the data to model.
180164 // ! \param[in] startTime The start of the time interval for which
@@ -187,13 +171,11 @@ class MODEL_EXPORT CDataGatherer {
187171 model_t ::ESummaryMode summaryMode,
188172 const SModelParams& modelParams,
189173 const std::string& summaryCountFieldName,
190- const std::string& partitionFieldName,
191174 const std::string& partitionFieldValue,
192175 const std::string& personFieldName,
193176 const std::string& attributeFieldName,
194177 const std::string& valueFieldName,
195178 const TStrVec& influenceFieldNames,
196- bool useNull,
197179 const CSearchKey& key,
198180 const TFeatureVec& features,
199181 core_t ::TTime startTime,
@@ -204,13 +186,11 @@ class MODEL_EXPORT CDataGatherer {
204186 model_t ::ESummaryMode summaryMode,
205187 const SModelParams& modelParams,
206188 const std::string& summaryCountFieldName,
207- const std::string& partitionFieldName,
208189 const std::string& partitionFieldValue,
209190 const std::string& personFieldName,
210191 const std::string& attributeFieldName,
211192 const std::string& valueFieldName,
212193 const TStrVec& influenceFieldNames,
213- bool useNull,
214194 const CSearchKey& key,
215195 core::CStateRestoreTraverser& traverser);
216196
@@ -220,8 +200,9 @@ class MODEL_EXPORT CDataGatherer {
220200 // ! redundant except to create a signature that will not be mistaken for
221201 // ! a general purpose copy constructor.
222202 CDataGatherer (bool isForPersistence, const CDataGatherer& other);
223-
224203 ~CDataGatherer ();
204+ CDataGatherer (const CDataGatherer&) = delete ;
205+ CDataGatherer& operator =(const CDataGatherer&) = delete ;
225206 // @}
226207
227208 // ! \name Persistence
@@ -546,7 +527,7 @@ class MODEL_EXPORT CDataGatherer {
546527 void resetSampleCount (std::size_t id);
547528
548529 // ! Get the sample counts.
549- TSampleCountsPtr sampleCounts () const ;
530+ const TSampleCountsPtr& sampleCounts () const ;
550531 // @}
551532
552533 // ! \name Time
@@ -759,7 +740,7 @@ class MODEL_EXPORT CDataGatherer {
759740
760741 // ! The collection of bucket gatherers which contain the bucket-specific
761742 // ! metrics and counts.
762- TBucketGathererPVec m_Gatherers;
743+ TBucketGathererPtrVec m_Gatherers;
763744
764745 // ! Indicates whether the data being gathered are already summarized
765746 // ! by an external aggregation process.
@@ -768,15 +749,12 @@ class MODEL_EXPORT CDataGatherer {
768749 // ! The global configuration parameters.
769750 TModelParamsCRef m_Params;
770751
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 ;
773754
774755 // ! The value of the partition field for this detector.
775756 core::CStoredStringPtr m_PartitionFieldValue;
776757
777- // ! The key of the search for which data is being gathered.
778- TSearchKeyCRef m_SearchKey;
779-
780758 // ! A registry where person names are mapped to unique IDs.
781759 CDynamicStringIdRegistry m_PeopleRegistry;
782760
0 commit comments