DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
//======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // 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) //======================================================================= // // Revision History: // 01 April 2001: Modified to use new
header. (JMaddock) // #ifndef BOOST_GRAPH_GRAPH_SEARCH_VISITORS_HPP #define BOOST_GRAPH_GRAPH_SEARCH_VISITORS_HPP #include
#include
#include
#include
#include
#include
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // Stay out of the way of the concept checking class # define Graph Graph_ #endif namespace boost { // This is a bit more convenient than std::numeric_limits because // you don't have to explicitly provide type T. template
inline T numeric_limits_max(T) { return (std::numeric_limits
::max)(); } //======================================================================== // Event Tags namespace detail { // For partial specialization workaround enum event_visitor_enum { on_no_event_num, on_initialize_vertex_num, on_start_vertex_num, on_discover_vertex_num, on_finish_vertex_num, on_examine_vertex_num, on_examine_edge_num, on_tree_edge_num, on_non_tree_edge_num, on_gray_target_num, on_black_target_num, on_forward_or_cross_edge_num, on_back_edge_num, on_edge_relaxed_num, on_edge_not_relaxed_num, on_edge_minimized_num, on_edge_not_minimized_num }; template
struct functor_to_visitor : Visitor { typedef Event event_filter; functor_to_visitor(const Visitor& visitor) : Visitor(visitor) {} }; } // namespace detail struct on_no_event { enum { num = detail::on_no_event_num }; }; struct on_initialize_vertex { enum { num = detail::on_initialize_vertex_num }; }; struct on_start_vertex { enum { num = detail::on_start_vertex_num }; }; struct on_discover_vertex { enum { num = detail::on_discover_vertex_num }; }; struct on_examine_vertex { enum { num = detail::on_examine_vertex_num }; }; struct on_finish_vertex { enum { num = detail::on_finish_vertex_num }; }; struct on_examine_edge { enum { num = detail::on_examine_edge_num }; }; struct on_tree_edge { enum { num = detail::on_tree_edge_num }; }; struct on_non_tree_edge { enum { num = detail::on_non_tree_edge_num }; }; struct on_gray_target { enum { num = detail::on_gray_target_num }; }; struct on_black_target { enum { num = detail::on_black_target_num }; }; struct on_forward_or_cross_edge { enum { num = detail::on_forward_or_cross_edge_num }; }; struct on_back_edge { enum { num = detail::on_back_edge_num }; }; struct on_edge_relaxed { enum { num = detail::on_edge_relaxed_num }; }; struct on_edge_not_relaxed { enum { num = detail::on_edge_not_relaxed_num }; }; struct on_edge_minimized { enum { num = detail::on_edge_minimized_num }; }; struct on_edge_not_minimized { enum { num = detail::on_edge_not_minimized_num }; }; struct true_tag { enum { num = true }; }; struct false_tag { enum { num = false }; }; //======================================================================== // base_visitor and null_visitor // needed for MSVC workaround template
struct base_visitor { typedef on_no_event event_filter; template
void operator()(T, Graph&) { } }; struct null_visitor : public base_visitor
{ typedef on_no_event event_filter; template
void operator()(T, Graph&) { } }; //======================================================================== // The invoke_visitors() function namespace detail { template
inline void invoke_dispatch(Visitor& v, T x, Graph& g, true_tag) { v(x, g); } template
inline void invoke_dispatch(Visitor&, T, Graph&, false_tag) { } } // namespace detail template
inline void invoke_visitors(std::pair
& vlist, T x, Graph& g, Tag tag) { typedef typename Visitor::event_filter Category; typedef typename graph_detail::is_same
::is_same_tag IsSameTag; detail::invoke_dispatch(vlist.first, x, g, IsSameTag()); invoke_visitors(vlist.second, x, g, tag); } #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 template
inline void invoke_visitors(base_visitor
& vis, T x, Graph& g, Tag) { typedef typename Visitor::event_filter Category; typedef typename graph_detail::is_same
::is_same_tag IsSameTag; Visitor& v = static_cast
(vis); detail::invoke_dispatch(v, x, g, IsSameTag()); } #else template
inline void invoke_visitors(Visitor& v, T x, Graph& g, Tag) { typedef typename Visitor::event_filter Category; typedef typename graph_detail::is_same
::is_same_tag IsSameTag; detail::invoke_dispatch(v, x, g, IsSameTag()); } #endif //======================================================================== // predecessor_recorder template
struct predecessor_recorder : public base_visitor
> { typedef Tag event_filter; predecessor_recorder(PredecessorMap pa) : m_predecessor(pa) { } template
void operator()(Edge e, const Graph& g) { put(m_predecessor, target(e, g), source(e, g)); } PredecessorMap m_predecessor; }; template
predecessor_recorder
record_predecessors(PredecessorMap pa, Tag) { return predecessor_recorder
(pa); } //======================================================================== // edge_predecessor_recorder template
struct edge_predecessor_recorder : public base_visitor
> { typedef Tag event_filter; edge_predecessor_recorder(PredEdgeMap pa) : m_predecessor(pa) { } template
void operator()(Edge e, const Graph& g) { put(m_predecessor, target(e, g), e); } PredEdgeMap m_predecessor; }; template
edge_predecessor_recorder
record_edge_predecessors(PredEdgeMap pa, Tag) { return edge_predecessor_recorder
(pa); } //======================================================================== // distance_recorder template
struct distance_recorder : public base_visitor
> { typedef Tag event_filter; distance_recorder(DistanceMap pa) : m_distance(pa) { } template
void operator()(Edge e, const Graph& g) { typename graph_traits
::vertex_descriptor u = source(e, g), v = target(e, g); put(m_distance, v, get(m_distance, u) + 1); } DistanceMap m_distance; }; template
distance_recorder
record_distances(DistanceMap pa, Tag) { return distance_recorder
(pa); } //======================================================================== // time_stamper template
struct time_stamper : public base_visitor
> { typedef Tag event_filter; time_stamper(TimeMap pa, TimeT& t) : m_time_pa(pa), m_time(t) { } template
void operator()(Vertex u, const Graph&) { put(m_time_pa, u, ++m_time); } TimeMap m_time_pa; TimeT& m_time; }; template
time_stamper
stamp_times(TimeMap pa, TimeT& time_counter, Tag) { return time_stamper
(pa, time_counter); } //======================================================================== // property_writer template
struct property_writer : public base_visitor
> { typedef Tag event_filter; property_writer(PA pa, OutputIterator out) : m_pa(pa), m_out(out) { } template
void operator()(T x, Graph&) { *m_out++ = get(m_pa, x); } PA m_pa; OutputIterator m_out; }; template
property_writer
write_property(PA pa, OutputIterator out, Tag) { return property_writer
(pa, out); } #define BOOST_GRAPH_EVENT_STUB(Event,Kind) \ typedef ::boost::Event Event##_type; \ template
\ Kind##_visitor
, Visitors> > \ do_##Event(Visitor visitor) \ { \ typedef std::pair
, \ Visitors> visitor_list; \ typedef Kind##_visitor
result_type; \ return result_type(visitor_list(visitor, m_vis)); \ } } /* namespace boost */ #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // Stay out of the way of the concept checking class # undef Graph #endif #endif
visitors.hpp
Page URL
File URL
Prev
93/95
Next
Download
( 10 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.