YARP
Yet Another Robot Platform
Stamp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_OS_STAMP_H
11 #define YARP_OS_STAMP_H
12 
13 #include <yarp/os/NetFloat64.h>
14 #include <yarp/os/NetInt32.h>
15 #include <yarp/os/Portable.h>
16 
17 
18 namespace yarp {
19 namespace os {
20 
24 class YARP_os_API Stamp : public Portable
25 {
26 private:
27  NetInt32 sequenceNumber;
28  NetFloat64 timeStamp;
29 
30 public:
34  explicit Stamp();
35 
43  Stamp(int count, double time);
44 
50  int getCount() const;
51 
57  double getTime() const;
58 
64  bool isValid() const;
65 
72  int getMaxCount() const;
73 
78  void update();
79 
84  void update(double time);
85 
86  // Documented in Portable
87  bool read(ConnectionReader& connection) override;
88 
89  // Documented in Portable
90  bool write(ConnectionWriter& connection) const override;
91 };
92 
93 
94 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
95 
100 {
101 public:
105  virtual ~Stamped();
106 
111  virtual Stamp getStamp() const = 0;
112 };
113 #endif // YARP_NO_DEPRECATED
114 
115 } // namespace os
116 } // namespace yarp
117 
118 #endif // YARP_OS_STAMP_H
yarp::os::impl::getTime
void getTime(YARP_timeval &now)
Definition: PlatformTime.cpp:18
yarp::os::Portable
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:29
yarp::sig::file::read
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:827
NetInt32.h
yarp::os::Time::isValid
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:317
Portable.h
YARP_os_API
#define YARP_os_API
Definition: api.h:19
YARP_os_DEPRECATED_API
#define YARP_os_DEPRECATED_API
Definition: api.h:22
yarp::os::Stamped::getStamp
virtual Stamp getStamp() const =0
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
NetFloat64.h
yarp::os::Stamped
A base class for objects with time stamps and/or sequence numbers.
Definition: Stamp.h:100
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::Stamp
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:25
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::Stamped::~Stamped
virtual ~Stamped()
Destructor.
yarp::os::NetFloat64
yarp::conf::float64_t NetFloat64
Definition of the NetFloat64 type.
Definition: NetFloat64.h:45
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971
yarp::os::NetInt32
std::int32_t NetInt32
Definition of the NetInt32 type.
Definition: NetInt32.h:33