mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix net/endian.hpp
This commit is contained in:
parent
7f8a352783
commit
93e22a984d
10 changed files with 651 additions and 10 deletions
42
tools/sprig/graph/back_edge_recorder.hpp
Normal file
42
tools/sprig/graph/back_edge_recorder.hpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||
https://github.com/bolero-MURAKAMI/Sprout
|
||||
|
||||
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 TOOLS_SPRIG_GRAPH_BACK_EDGE_RECORDER_HPP
|
||||
#define TOOLS_SPRIG_GRAPH_BACK_EDGE_RECORDER_HPP
|
||||
|
||||
#include <boost/graph/depth_first_search.hpp>
|
||||
|
||||
namespace sprig {
|
||||
//
|
||||
// back_edge_recorder
|
||||
//
|
||||
template<typename OutputIterator>
|
||||
struct back_edge_recorder
|
||||
: public boost::default_dfs_visitor
|
||||
{
|
||||
private:
|
||||
OutputIterator out_;
|
||||
public:
|
||||
explicit back_edge_recorder(OutputIterator out)
|
||||
: out_(out)
|
||||
{}
|
||||
template<typename Edge, typename Graph>
|
||||
void back_edge(Edge const& e, Graph const&) {
|
||||
*out_++ = e;
|
||||
}
|
||||
};
|
||||
//
|
||||
// make_back_edge_recorder
|
||||
//
|
||||
template<typename OutputIterator >
|
||||
inline sprig::back_edge_recorder<OutputIterator>
|
||||
make_back_edge_recorder(OutputIterator out) {
|
||||
return sprig::back_edge_recorder<OutputIterator>(out);
|
||||
}
|
||||
} // namespace sprig
|
||||
|
||||
#endif // #ifndef TOOLS_SPRIG_GRAPH_BACK_EDGE_RECORDER_HPP
|
13
tools/sprig/graph/depth_first_search.hpp
Normal file
13
tools/sprig/graph/depth_first_search.hpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||
https://github.com/bolero-MURAKAMI/Sprout
|
||||
|
||||
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 TOOLS_SPRIG_GRAPH_DEPTH_FIRST_SEARCH_HPP
|
||||
#define TOOLS_SPRIG_GRAPH_DEPTH_FIRST_SEARCH_HPP
|
||||
|
||||
#include "./back_edge_recorder.hpp"
|
||||
|
||||
#endif // #ifndef TOOLS_SPRIG_GRAPH_DEPTH_FIRST_SEARCH_HPP
|
Loading…
Add table
Add a link
Reference in a new issue