Skip to content

Commit

Permalink
Working on #189 and #190
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Jun 11, 2014
1 parent a2a0734 commit cbd768c
Show file tree
Hide file tree
Showing 10 changed files with 540 additions and 619 deletions.
202 changes: 0 additions & 202 deletions hpx/components/iostreams/lazy_ostream.hpp

This file was deleted.

111 changes: 60 additions & 51 deletions hpx/components/iostreams/manipulators.hpp
@@ -1,10 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011 Bryce Lelbach
// Copyright (c) 2013 Hartmut Kaiser
// Copyright (c) 2013-2014 Hartmut Kaiser
//
// 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)
////////////////////////////////////////////////////////////////////////////////

#if !defined(HPX_9CF0FD9D_039C_4046_B244_C7FCC97D9945)
#define HPX_9CF0FD9D_039C_4046_B244_C7FCC97D9945
Expand All @@ -16,54 +14,65 @@

namespace hpx { namespace iostreams
{

struct sync_flush_type { };
struct sync_endl_type { };
struct flush_type : sync_flush_type { };
struct endl_type : sync_endl_type { };
struct async_flush_type { };
struct async_endl_type { };
struct local_flush_type { };
struct local_endl_type { };

HPX_IOSTREAMS_EXPORT extern sync_flush_type sync_flush;
HPX_IOSTREAMS_EXPORT extern sync_endl_type sync_endl;
HPX_IOSTREAMS_EXPORT extern flush_type flush; // alias for hpx::sync_flush
HPX_IOSTREAMS_EXPORT extern endl_type endl; // alias for hpx::sync_endl
HPX_IOSTREAMS_EXPORT extern async_flush_type async_flush;
HPX_IOSTREAMS_EXPORT extern async_endl_type async_endl;
HPX_IOSTREAMS_EXPORT extern local_flush_type local_flush;
HPX_IOSTREAMS_EXPORT extern local_endl_type local_endl;

inline std::ostream& operator<< (std::ostream& os, sync_flush_type const&)
{ return os << std::flush; }

inline std::ostream& operator<< (std::ostream& os, sync_endl_type const&)
{ return os << std::endl << std::flush; }

inline std::ostream& operator<< (std::ostream& os, async_flush_type const&)
{ return os << std::flush; }

inline std::ostream& operator<< (std::ostream& os, async_endl_type const&)
{ return os << std::endl << std::flush; }

inline std::ostream& operator<< (std::ostream& os, local_flush_type const&)
{ return os << std::flush; }

inline std::ostream& operator<< (std::ostream& os, local_endl_type const&)
{ return os << std::endl << std::flush; }

}

using iostreams::sync_flush;
using iostreams::sync_endl;
using iostreams::flush;
using iostreams::endl;
using iostreams::async_flush;
using iostreams::async_endl;
using iostreams::local_flush;
using iostreams::local_endl;

struct sync_flush_type {};
struct sync_endl_type {};
struct flush_type : sync_flush_type {};
struct endl_type : sync_endl_type {};
struct async_flush_type {};
struct async_endl_type {};
struct local_flush_type {};
struct local_endl_type {};

HPX_IOSTREAMS_EXPORT extern sync_flush_type sync_flush;
HPX_IOSTREAMS_EXPORT extern sync_endl_type sync_endl;
HPX_IOSTREAMS_EXPORT extern flush_type flush; // alias for hpx::sync_flush
HPX_IOSTREAMS_EXPORT extern endl_type endl; // alias for hpx::sync_endl
HPX_IOSTREAMS_EXPORT extern async_flush_type async_flush;
HPX_IOSTREAMS_EXPORT extern async_endl_type async_endl;
HPX_IOSTREAMS_EXPORT extern local_flush_type local_flush;
HPX_IOSTREAMS_EXPORT extern local_endl_type local_endl;

inline std::ostream& operator<< (std::ostream& os, sync_flush_type const&)
{
return os << std::flush;
}

inline std::ostream& operator<< (std::ostream& os, sync_endl_type const&)
{
return os << std::endl << std::flush;
}

inline std::ostream& operator<< (std::ostream& os, async_flush_type const&)
{
return os << std::flush;
}

inline std::ostream& operator<< (std::ostream& os, async_endl_type const&)
{
return os << std::endl << std::flush;
}

inline std::ostream& operator<< (std::ostream& os, local_flush_type const&)
{
return os << std::flush;
}

inline std::ostream& operator<< (std::ostream& os, local_endl_type const&)
{
return os << std::endl << std::flush;
}
}}

namespace hpx
{
using iostreams::sync_flush;
using iostreams::sync_endl;
using iostreams::flush;
using iostreams::endl;
using iostreams::async_flush;
using iostreams::async_endl;
using iostreams::local_flush;
using iostreams::local_endl;
}

#endif // HPX_9CF0FD9D_039C_4046_B244_C7FCC97D9945
Expand Down

0 comments on commit cbd768c

Please sign in to comment.