From 618206f410471b6ae7c25bf6286d91616ce9f6a5 Mon Sep 17 00:00:00 2001 From: mat007 Date: Thu, 10 Dec 2009 23:34:26 +0000 Subject: [PATCH] Clean-up git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@71 860be788-9bd5-4423-9f1e-828f051e677b --- build/vc80/turtle.vcproj | 4 ++++ src/libraries/turtle/mock.hpp | 12 ++++++------ src/libraries/turtle/orderable.hpp | 30 ++++++++++++++++++++++++++++++ src/libraries/turtle/sequence.hpp | 15 +-------------- 4 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 src/libraries/turtle/orderable.hpp diff --git a/build/vc80/turtle.vcproj b/build/vc80/turtle.vcproj index 9276e53..461616d 100644 --- a/build/vc80/turtle.vcproj +++ b/build/vc80/turtle.vcproj @@ -204,6 +204,10 @@ RelativePath="..\..\src\libraries\turtle\object.hpp" > + + diff --git a/src/libraries/turtle/mock.hpp b/src/libraries/turtle/mock.hpp index de87a21..646c4b6 100644 --- a/src/libraries/turtle/mock.hpp +++ b/src/libraries/turtle/mock.hpp @@ -124,20 +124,20 @@ namespace detail template< typename E > 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 ) { - if( object != "?" || e.tag() == "?" ) - e.tag( object ); + if( parent != "?" || e.tag() == "?" ) + e.tag( parent ); return e; } 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 ) { set_parent( e, t ); - if( object != "?" || e.tag() == "?" ) - e.tag( object + op + type_name< T >() + "::" + name ); + if( parent != "?" || e.tag() == "?" ) + e.tag( parent + op + type_name< T >() + "::" + name ); return e; } diff --git a/src/libraries/turtle/orderable.hpp b/src/libraries/turtle/orderable.hpp new file mode 100644 index 0000000..1404225 --- /dev/null +++ b/src/libraries/turtle/orderable.hpp @@ -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 diff --git a/src/libraries/turtle/sequence.hpp b/src/libraries/turtle/sequence.hpp index 0964d26..59066a8 100644 --- a/src/libraries/turtle/sequence.hpp +++ b/src/libraries/turtle/sequence.hpp @@ -9,25 +9,12 @@ #ifndef MOCK_SEQUENCE_HPP_INCLUDED #define MOCK_SEQUENCE_HPP_INCLUDED +#include "orderable.hpp" #include #include namespace mock { - class sequence; - -namespace detail -{ - class orderable - { - public: - orderable() {} - virtual ~orderable() {} - - virtual void remove( sequence& s ) = 0; - }; -} - class sequence { public: