mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Removed obsolete file
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@444 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
fbc466752c
commit
d403d5a6c7
1 changed files with 0 additions and 56 deletions
|
|
@ -1,56 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright Mathieu Champlon 2008
|
|
||||||
//
|
|
||||||
// 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)
|
|
||||||
//
|
|
||||||
// See http://turtle.sf.net for documentation.
|
|
||||||
|
|
||||||
#ifndef MOCK_NODE_HPP_INCLUDED
|
|
||||||
#define MOCK_NODE_HPP_INCLUDED
|
|
||||||
|
|
||||||
#include "verifiable.hpp"
|
|
||||||
#include <functional>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace mock
|
|
||||||
{
|
|
||||||
class node
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void add( verifiable& v )
|
|
||||||
{
|
|
||||||
v_.push_back( &v );
|
|
||||||
}
|
|
||||||
void remove( verifiable& v )
|
|
||||||
{
|
|
||||||
v_.erase( std::remove( v_.begin(), v_.end(), &v ), v_.end() );
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool verify() const
|
|
||||||
{
|
|
||||||
bool valid = true;
|
|
||||||
for( verifiables_cit it = v_.begin(); it != v_.end(); ++it )
|
|
||||||
if( ! (*it)->verify() )
|
|
||||||
valid = false;
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
virtual void reset()
|
|
||||||
{
|
|
||||||
std::for_each( v_.begin(), v_.end(),
|
|
||||||
std::mem_fun( &verifiable::reset ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef std::vector< verifiable* > verifiables_type;
|
|
||||||
typedef verifiables_type::const_iterator verifiables_cit;
|
|
||||||
|
|
||||||
std::vector< verifiable* > v_;
|
|
||||||
std::string name_;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // MOCK_NODE_HPP_INCLUDED
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue