git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@498 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-07-22 07:07:47 +00:00
parent f1cc1321e8
commit 8cdf6f5934
8 changed files with 28 additions and 42 deletions

View file

@ -23,24 +23,24 @@ namespace mock
{
namespace detail
{
class object_impl : public detail::context, public detail::verifiable,
class object_impl : public context, public verifiable,
public boost::enable_shared_from_this< object_impl >
{
public:
virtual void add( const void* /*p*/, detail::verifiable& v,
virtual void add( const void* /*p*/, verifiable& v,
boost::unit_test::const_string instance,
boost::optional< detail::type_name > type,
boost::optional< type_name > type,
boost::unit_test::const_string name )
{
if( children_.empty() )
mock::detail::root.add( *this );
children_[ &v ].update( parent_, instance, type, name );
}
virtual void add( detail::verifiable& v )
virtual void add( verifiable& v )
{
group_.add( v );
}
virtual void remove( detail::verifiable& v )
virtual void remove( verifiable& v )
{
group_.remove( v );
children_.erase( &v );
@ -48,8 +48,7 @@ namespace detail
mock::detail::root.remove( *this );
}
virtual void serialize( std::ostream& s,
const detail::verifiable& v ) const
virtual void serialize( std::ostream& s, const verifiable& v ) const
{
children_cit it = children_.find( &v );
if( it != children_.end() )
@ -69,14 +68,11 @@ namespace detail
}
private:
typedef std::map<
const detail::verifiable*,
detail::child
> children_t;
typedef std::map< const verifiable*, child > children_t;
typedef children_t::const_iterator children_cit;
detail::group group_;
detail::parent parent_;
group group_;
parent parent_;
children_t children_;
};
}