git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@71 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2009-12-10 23:34:26 +00:00
parent eb78cf942e
commit 618206f410
4 changed files with 41 additions and 20 deletions

View file

@ -204,6 +204,10 @@
RelativePath="..\..\src\libraries\turtle\object.hpp" RelativePath="..\..\src\libraries\turtle\object.hpp"
> >
</File> </File>
<File
RelativePath="..\..\src\libraries\turtle\orderable.hpp"
>
</File>
<File <File
RelativePath="..\..\src\libraries\turtle\placeholder.hpp" RelativePath="..\..\src\libraries\turtle\placeholder.hpp"
> >

View file

@ -124,20 +124,20 @@ namespace detail
template< typename E > template< typename E >
E& configure( BOOST_DEDUCED_TYPENAME E::expectation_tag, E& configure( BOOST_DEDUCED_TYPENAME E::expectation_tag,
const std::string& object, const std::string& /*op*/, const std::string& parent, const std::string& /*op*/,
const std::string& /*name*/, E& e ) const std::string& /*name*/, E& e )
{ {
if( object != "?" || e.tag() == "?" ) if( parent != "?" || e.tag() == "?" )
e.tag( object ); e.tag( parent );
return e; return e;
} }
template< typename E, typename T > template< typename E, typename T >
E& configure( E& e, const std::string& object, const std::string& op, E& configure( E& e, const std::string& parent, const std::string& op,
const std::string& name, const T& t ) const std::string& name, const T& t )
{ {
set_parent( e, t ); set_parent( e, t );
if( object != "?" || e.tag() == "?" ) if( parent != "?" || e.tag() == "?" )
e.tag( object + op + type_name< T >() + "::" + name ); e.tag( parent + op + type_name< T >() + "::" + name );
return e; return e;
} }

View file

@ -0,0 +1,30 @@
//
// Copyright Mathieu Champlon 2009
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MOCK_ORDERABLE_HPP_INCLUDED
#define MOCK_ORDERABLE_HPP_INCLUDED
namespace mock
{
class sequence;
namespace detail
{
class orderable
{
public:
orderable() {}
virtual ~orderable() {}
virtual void remove( sequence& s ) = 0;
};
}
}
#endif // #ifndef MOCK_ORDERABLE_HPP_INCLUDED

View file

@ -9,25 +9,12 @@
#ifndef MOCK_SEQUENCE_HPP_INCLUDED #ifndef MOCK_SEQUENCE_HPP_INCLUDED
#define MOCK_SEQUENCE_HPP_INCLUDED #define MOCK_SEQUENCE_HPP_INCLUDED
#include "orderable.hpp"
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
namespace mock namespace mock
{ {
class sequence;
namespace detail
{
class orderable
{
public:
orderable() {}
virtual ~orderable() {}
virtual void remove( sequence& s ) = 0;
};
}
class sequence class sequence
{ {
public: public: