13 #include <solv/transaction.h>
14 #include <solv/solver.h>
52 friend std::ostream &
operator<<( std::ostream & str,
const Impl & obj );
55 typedef std::unordered_set<detail::IdType>
set_type;
56 typedef std::unordered_map<detail::IdType,detail::IdType>
map_type;
65 ,
_arch( solv_r.arch() )
72 typedef std::unordered_map<detail::IdType,PostMortem>
pmmap_type;
86 if ( ! pi.status().transacts() )
88 decisionq.
push( pi.isSystem() ? -pi.id() : pi.id() );
93 noobsq.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
94 noobsq.
push( solv.id() );
97 ::solver_calculate_noobsmap(
myPool().getPool(), noobsq, noobsmap );
98 _trans = ::transaction_create_decisionq(
myPool().getPool(), decisionq, noobsmap );
130 { ::transaction_free(
_trans ); }
146 ::transaction_order(
_trans, SOLVER_TRANSACTION_KEEP_ORDERDATA );
152 int ret = transaction_order_add_choices(
_trans, chosen, choices );
153 MIL << ret <<
": " << chosen <<
": " << choices << endl;
162 ::transaction_order(
_trans, 0 );
169 {
return(
_trans->steps.count == 0 ); }
172 {
return _trans->steps.count; }
191 { return ::transaction_installedresult(
_trans, result_r ); }
208 switch( ::transaction_type(
_trans, solv_r.
id(), SOLVER_TRANSACTION_RPM_ONLY ) )
226 pmmap_type::const_iterator it(
_pmMap.find( solv_r.
id() ) );
227 return( it ==
_pmMap.end() ? _none : it->second );
233 map_type::const_iterator res(
_linkMap.find( solv_r.
id() ) );
234 return( res ==
_linkMap.end() ? solv_r.
id() : res->second );
238 {
return( set_r.find( sid_r ) != set_r.end() ); }
252 if ( stage != newval_r )
269 if ( solv_r &&
_trans->steps.elements )
297 static shared_ptr<Impl> _nullimpl(
new Impl );
305 return str <<
"Transaction: " << obj.
size() <<
" (" << (obj.
valid()?
"valid":
"INVALID") <<
")";
315 : _pimpl(
Impl::nullimpl() )
319 : _pimpl( new
Impl( loadFromPool ) )
365 {
return str << *obj.
_pimpl; }
412 str <<
'[' << obj.
ident() <<
'-' << obj.
edition() <<
'.' << obj.
arch() <<
']';
420 #define OUTS(E,S) case Transaction::E: return str << #S; break
434 #define OUTS(E,S) case Transaction::E: return str << #S; break
440 return str <<
"[??]";
451 Transaction_const_iterator::Transaction_const_iterator()
457 , _pimpl( iter_r._pimpl )