MRPT  2.0.0
CAction.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "obs-precomp.h" // Precompiled headers
11 
12 #include <mrpt/obs/CAction.h>
14 #include <iomanip>
15 #include <iostream>
16 #include <sstream>
17 
18 using namespace mrpt::obs;
19 
21 
22 void CAction::getDescriptionAsText(std::ostream& o) const
23 {
24  using namespace mrpt::system; // for the TTimeStamp << op
25 
26  o << "Timestamp (UTC): " << mrpt::system::dateTimeToString(timestamp)
27  << std::endl;
28  o << " (as time_t): " << std::fixed << std::setprecision(5)
29  << mrpt::system::timestampTotime_t(timestamp) << std::endl;
30  o << " (as TTimestamp): " << timestamp << std::endl;
31  o << std::endl;
32 }
33 
35 {
36  std::stringstream ss;
38  return ss.str();
39 }
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class, NS)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
STL namespace.
double timestampTotime_t(const mrpt::system::TTimeStamp t) noexcept
Transform from TTimeStamp to standard "time_t" (actually a double number, it can contain fractions of...
Definition: datetime.h:105
This namespace contains representation of robot actions and observations.
Declares a class for storing a robot action.
Definition: CAction.h:24
std::string dateTimeToString(const mrpt::system::TTimeStamp t)
Convert a timestamp into this textual form (UTC time): YEAR/MONTH/DAY,HH:MM:SS.MMM.
Definition: datetime.cpp:154
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the action contents and dump it to the output str...
Definition: CAction.cpp:22
std::string getDescriptionAsTextValue() const
Return by value version of getDescriptionAsText(std::ostream&)
Definition: CAction.cpp:34



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020