diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/icl/test/chrono | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/icl/test/chrono')
-rw-r--r-- | src/boost/libs/icl/test/chrono/utility.hpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/boost/libs/icl/test/chrono/utility.hpp b/src/boost/libs/icl/test/chrono/utility.hpp new file mode 100644 index 00000000..5c12e31b --- /dev/null +++ b/src/boost/libs/icl/test/chrono/utility.hpp @@ -0,0 +1,49 @@ +/*-----------------------------------------------------------------------------+ +Copyright (c) 2011-2011: Joachim Faulhaber ++------------------------------------------------------------------------------+ + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENCE.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) ++-----------------------------------------------------------------------------*/ +#ifndef BOOST_LIBS_ICL_TEST_CHRONO_UTILITY_HPP_JOFA_20110314 +#define BOOST_LIBS_ICL_TEST_CHRONO_UTILITY_HPP_JOFA_20110314 + +#include <boost/chrono/chrono.hpp> +#include <boost/chrono/chrono_io.hpp> + +// In order to perform simple testing with chrono::time_point +// we need to provide a dummy test clock + +class Now // A trivial test clock +{ +public: + typedef boost::chrono::duration<int> duration; + typedef duration::rep rep; + typedef duration::period periond; + typedef boost::chrono::time_point<Now> time_point; + + static time_point now(){ return time_point(); } +}; + +namespace boost{ namespace chrono { + +template <class CharT> +struct clock_string<Now, CharT> +{ + static std::basic_string<CharT> name() + { + static const CharT u[] = {'n', 'o', 'w', '_', 'c', 'l','o', 'c', 'k'}; + static const std::basic_string<CharT> str(u, u + sizeof(u)/sizeof(u[0])); + return str; + } + static std::basic_string<CharT> since() + { + const CharT u[] = {' ', 's', 'i', 'n', 'c', 'e', ' ', 'n', 'o', 'w'}; + const std::basic_string<CharT> str(u, u + sizeof(u)/sizeof(u[0])); + return str; + } +}; + +}} //namespace boost chrono + +#endif //BOOST_LIBS_ICL_TEST_CHRONO_UTILITY_HPP_JOFA_20110314 |