YARP
Yet Another Robot Platform
Stamp.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_STAMP_H
8 #define YARP_OS_STAMP_H
9 
10 #include <yarp/os/NetFloat64.h>
11 #include <yarp/os/NetInt32.h>
12 #include <yarp/os/Portable.h>
13 
14 
15 namespace yarp::os {
16 
20 class YARP_os_API Stamp : public Portable
21 {
22 private:
23  NetInt32 sequenceNumber;
24  NetFloat64 timeStamp;
25 
26 public:
30  explicit Stamp();
31 
39  Stamp(int count, double time);
40 
46  int getCount() const;
47 
53  double getTime() const;
54 
60  bool isValid() const;
61 
68  int getMaxCount() const;
69 
74  void update();
75 
80  void update(double time);
81 
82  // Documented in Portable
83  bool read(ConnectionReader& connection) override;
84 
85  // Documented in Portable
86  bool write(ConnectionWriter& connection) const override;
87 };
88 
89 
90 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
95 class YARP_os_DEPRECATED_API Stamped
96 {
97 public:
101  virtual ~Stamped();
102 
107  virtual Stamp getStamp() const = 0;
108 };
109 #endif // YARP_NO_DEPRECATED
110 
111 } // namespace yarp::os
112 
113 #endif // YARP_OS_STAMP_H
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:25
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:21
virtual Stamp getStamp() const =0
virtual ~Stamped()
Destructor.
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
void getTime(YARP_timeval &now)
An interface to the operating system, including Port based communication.
yarp::conf::float64_t NetFloat64
Definition of the NetFloat64 type.
Definition: NetFloat64.h:41
std::int32_t NetInt32
Definition of the NetInt32 type.
Definition: NetInt32.h:29
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:915
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1091
#define YARP_os_API
Definition: api.h:18