problems.
MIL << "-----------------------------------------------------------------" << endl;
MIL << counter++ << ". failed queue:" << endl;
ResolverQueue_Ptr invalid = *iter;
- invalid->context()->spewInfo ();
+// invalid->context()->spewInfo (); No additional information needed here
MIL << *invalid->context() << endl;
MIL << "-----------------------------------------------------------------" << endl;
}
void
ResolverContext::foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn, void *data,
- const bool merge) const
+ const bool merge, const bool findImportant) const
{
ResolverInfoList info_list;
&& info->priority() >= priority)
{
info_list.push_back( info );
+
+ if (!merge
+ && !findImportant) {
+ // invoke our callback in order to avoid an additional run over the complete list
+ fn( info, data );
+ }
}
}
context = context->_parent;
}
}
- mark_important_info( info_list );
+ if (findImportant) mark_important_info( info_list );
- // Walk across the list of info objects and invoke our callback
+ if (merge
+ || findImportant) {
+ // Walk across the list of info objects and invoke our callback
- for (ResolverInfoList::iterator iter = info_list.begin(); iter != info_list.end(); ++iter) {
- if (*iter != NULL) {
- fn( *iter, data );
+ for (ResolverInfoList::iterator iter = info_list.begin(); iter != info_list.end(); ++iter) {
+ if (*iter != NULL) {
+ fn( *iter, data );
+ }
}
}
}
ResolverContext::spewInfo (void) const
{
_XDEBUG( "ResolverContext[" << this << "]::spewInfo" );
- foreachInfo (PoolItem_Ref(), -1, spew_info_cb, NULL);
+ foreachInfo (PoolItem_Ref(), -1, spew_info_cb, NULL, false, false);
}
//---------------------------------------------------------------------------
void addError (ResolverInfo_Ptr info, bool askUser = false);// error progress info
// iterate over report log
- void foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn, void *data, const bool merge=true) const;
+ void foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn, void *data, const bool merge=true, const bool findImportant = true) const;
ResolverInfoList getInfo (void) const;
// Context compare to identify equal branches
typedef multimap<PoolItem_Ref, ResolverInfo_Ptr> ProblemMap;
typedef multimap<PoolItem_Ref, Capability> ItemCapabilityMap;
-typedef multimap<PoolItem_Ref, PoolItem_Ref> ConflictMap;
+typedef multimap<PoolItem_Ref, PoolItem_Ref> ConflictMap;
+
+#define MAXPROBLEMS 20
// match template over ItemCapabilityMap
template <class K, class V>
bool operator()( const CapAndItem & cai )
{
- DBG << cai.item << " requires " << cai.cap << endl;
+ _XDEBUG (cai.item << " requires " << cai.cap);
requirers.push_back( cai.item );
return true;
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
problems.push_back (problem);
}
+
+ if (problems.size() >= MAXPROBLEMS) {
+ MIL << "Max problems reached: " << MAXPROBLEMS << ". Do not regarding the rest." << endl;
+ break;
+ }
}
if (problems.empty()) {
context->spewInfo();