diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-02 15:40:36 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-12 02:55:44 +0100 |
commit | f2fd8d33d46edb8b3c4351d14f4abbc386ffbabf (patch) | |
tree | 087f1b61806834edd4349fb52ba69c5b1dd34756 /storageframework | |
parent | f97313b7611fc90f87c656c61c97ff2baa0b22a7 (diff) |
Include asciistream in implementation only.
Diffstat (limited to 'storageframework')
3 files changed, 36 insertions, 16 deletions
diff --git a/storageframework/src/vespa/storageframework/generic/clock/time.cpp b/storageframework/src/vespa/storageframework/generic/clock/time.cpp index 4a379124bda..db0c0b6697d 100644 --- a/storageframework/src/vespa/storageframework/generic/clock/time.cpp +++ b/storageframework/src/vespa/storageframework/generic/clock/time.cpp @@ -1,12 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/storageframework/generic/clock/time.h> - +#include "time.hpp" +#include "clock.h" #include <iomanip> -#include <sstream> -#include <vespa/storageframework/generic/clock/clock.h> -#include <sys/time.h> #include <vector> namespace storage { @@ -83,5 +79,12 @@ getRawMicroTime(const Clock& clock) return clock.getTimeInMicros().getTime(); } +template std::ostream& operator<< <MicroSecTime, 1>(std::ostream&, const Time<MicroSecTime, 1> &); +template std::ostream& operator<< <MilliSecTime, 1000>(std::ostream&, const Time<MilliSecTime, 1000> &); +template std::ostream& operator<< <SecondTime, 1000000>(std::ostream&, const Time<SecondTime, 1000000> &); + +template vespalib::asciistream& operator<< <MicroSecTime, 1>(vespalib::asciistream &, const Time<MicroSecTime, 1> &); +template vespalib::asciistream& operator<< <MilliSecTime, 1000>(vespalib::asciistream &, const Time<MilliSecTime, 1000> &); + } // framework } // storage diff --git a/storageframework/src/vespa/storageframework/generic/clock/time.h b/storageframework/src/vespa/storageframework/generic/clock/time.h index 6e4ee615441..70004a2dfb8 100644 --- a/storageframework/src/vespa/storageframework/generic/clock/time.h +++ b/storageframework/src/vespa/storageframework/generic/clock/time.h @@ -3,9 +3,10 @@ #include <boost/operators.hpp> #include <vespa/vespalib/stllike/string.h> -#include <vespa/vespalib/stllike/asciistream.h> -#include <limits> -#include <chrono> + +namespace vespalib { + class asciistream; +} namespace storage { namespace framework { @@ -92,14 +93,10 @@ Type& operator*(Type& type, Number n) { } template<typename Type, int MPU> -std::ostream& operator<<(std::ostream& out, const Time<Type, MPU>& t) { - return out << t.getTime(); -} +std::ostream& operator<<(std::ostream& out, const Time<Type, MPU>& t); template<typename Type, int MPU> -vespalib::asciistream& operator<<(vespalib::asciistream& out, const Time<Type, MPU>& t) { - return out << t.getTime(); -} +vespalib::asciistream& operator<<(vespalib::asciistream& out, const Time<Type, MPU>& t); class MicroSecTime; class MilliSecTime; @@ -176,4 +173,3 @@ inline MicroSecTime MilliSecTime::getMicros() const { } // framework } // storage - diff --git a/storageframework/src/vespa/storageframework/generic/clock/time.hpp b/storageframework/src/vespa/storageframework/generic/clock/time.hpp new file mode 100644 index 00000000000..3e39608cf12 --- /dev/null +++ b/storageframework/src/vespa/storageframework/generic/clock/time.hpp @@ -0,0 +1,21 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#pragma once + +#include "time.h" +#include <vespa/vespalib/stllike/asciistream.h> + +namespace storage { +namespace framework { + +template<typename Type, int MPU> +std::ostream& operator<<(std::ostream& out, const Time<Type, MPU>& t) { + return out << t.getTime(); +} + +template<typename Type, int MPU> +vespalib::asciistream& operator<<(vespalib::asciistream& out, const Time<Type, MPU>& t) { + return out << t.getTime(); +} + +} // framework +} // storage |