/** Tem. friend of PoolItem */
struct PoolItemSaver
{
+ void saveState( ResPool_Ref pool_r )
+ {
+ std::for_each( pool_r.begin(), pool_r.end(),
+ std::mem_fun_ref(&PoolItem::saveState) );
+ }
+
void saveState( ResPool_Ref pool_r, const ResObject::Kind & kind_r )
{
std::for_each( pool_r.byKindBegin(kind_r), pool_r.byKindEnd(kind_r),
std::mem_fun_ref(&PoolItem::saveState) );
}
+ void restoreState( ResPool_Ref pool_r )
+ {
+ std::for_each( pool_r.begin(), pool_r.end(),
+ std::mem_fun_ref(&PoolItem::restoreState) );
+ }
+
void restoreState( ResPool_Ref pool_r, const ResObject::Kind & kind_r )
{
std::for_each( pool_r.byKindBegin(kind_r), pool_r.byKindEnd(kind_r),
std::mem_fun_ref(&PoolItem::restoreState) );
}
+ bool diffState( ResPool_Ref pool_r ) const
+ {
+ // return whether some PoolItem::sameState reported \c false.
+ return( invokeOnEach( pool_r.begin(), pool_r.end(),
+ std::mem_fun_ref(&PoolItem::sameState) ) < 0 );
+ }
+
bool diffState( ResPool_Ref pool_r, const ResObject::Kind & kind_r ) const
{
// return whether some PoolItem::sameState reported \c false.
public:
+ void saveState() const
+ { PoolItemSaver().saveState( _pool ); }
+
void saveState( const ResObject::Kind & kind_r ) const
{ PoolItemSaver().saveState( _pool, kind_r ); }
+ void restoreState() const
+ { PoolItemSaver().restoreState( _pool ); }
+
void restoreState( const ResObject::Kind & kind_r ) const
{ PoolItemSaver().restoreState( _pool, kind_r ); }
+ bool diffState() const
+ { return PoolItemSaver().diffState( _pool ); }
+
bool diffState( const ResObject::Kind & kind_r ) const
{ return PoolItemSaver().diffState( _pool, kind_r ); }
ResPoolProxy::const_iterator ResPoolProxy::byKindEnd( const ResObject::Kind & kind_r ) const
{ return _pimpl->byKindEnd( kind_r ); }
+ void ResPoolProxy::saveState() const
+ { _pimpl->saveState(); }
+
void ResPoolProxy::saveState( const ResObject::Kind & kind_r ) const
{ _pimpl->saveState( kind_r ); }
+ void ResPoolProxy::restoreState() const
+ { _pimpl->restoreState(); }
+
void ResPoolProxy::restoreState( const ResObject::Kind & kind_r ) const
{ _pimpl->restoreState( kind_r ); }
+ bool ResPoolProxy::diffState() const
+ { return _pimpl->diffState(); }
+
bool ResPoolProxy::diffState( const ResObject::Kind & kind_r ) const
{ return _pimpl->diffState( kind_r ); }