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 {
16 namespace os {
17 
21 class YARP_os_API Stamp : public Portable
22 {
23 private:
24  NetInt32 sequenceNumber;
25  NetFloat64 timeStamp;
26 
27 public:
31  explicit Stamp();
32 
40  Stamp(int count, double time);
41 
47  int getCount() const;
48 
54  double getTime() const;
55 
61  bool isValid() const;
62 
69  int getMaxCount() const;
70 
75  void update();
76 
81  void update(double time);
82 
83  // Documented in Portable
84  bool read(ConnectionReader& connection) override;
85 
86  // Documented in Portable
87  bool write(ConnectionWriter& connection) const override;
88 };
89 
90 
91 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
96 class YARP_os_DEPRECATED_API Stamped
97 {
98 public:
102  virtual ~Stamped();
103 
108  virtual Stamp getStamp() const = 0;
109 };
110 #endif // YARP_NO_DEPRECATED
111 
112 } // namespace os
113 } // namespace yarp
114 
115 #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:26
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:22
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)
yarp::conf::float64_t NetFloat64
Definition of the NetFloat64 type.
Definition: NetFloat64.h:42
std::int32_t NetInt32
Definition of the NetInt32 type.
Definition: NetInt32.h:30
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:923
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1099
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18