19 #ifndef SNARK_APPLICATIONS_TIMESTAMPEDPOSITION_H_
20 #define SNARK_APPLICATIONS_TIMESTAMPEDPOSITION_H_
22 #include <snark/timing/time.h>
23 #include <comma/visiting/traits.h>
25 namespace snark{
namespace applications {
28 template <
typename T,
typename TimeType = boost::posix_time::ptime >
37 inline std::string toString(
const boost::posix_time::ptime& t ) {
return boost::posix_time::to_iso_string( t ); }
43 template <
typename T,
typename S >
44 inline std::ostream& operator<<( std::ostream& os, const snark::applications::timestamped< T, S >& rhs ) { os << snark::applications::detail::toString( rhs.t ) <<
"," << rhs.value;
return os; }
46 namespace comma {
namespace visiting {
48 template <
typename T,
typename S >
struct traits< snark::applications::timestamped< T, S > >
50 template <
typename Key,
class Visitor >
54 v.apply(
"value", p.value );
57 template <
typename Key,
class Visitor >
61 v.apply(
"value", p.value );