Skip to content

Commit

Permalink
Fix documentation and deprecation warnings (#265)
Browse files Browse the repository at this point in the history
The poll() API with integer timeout is deprecated.
Use std::chrono::duration instead.

Signed-off-by: Alejandro Hernández <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2021
1 parent 73bfba7 commit 0a813ec
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ Visit the [documentation page](https://ignitionrobotics.org/api/transport/11.0/i
```
ign-transport
├── conf Configuration file for the integration with the `ign` CLI tool.
├── docker Dockerfile with ign-transport installed and scripts to build and run the code.
├── example Example programs that use most of the Ignition Transport API.
├── include Header files that get installed.
├── log All the code related with Ignition Transport logging.
├── src Source code of the core library.
├── test A directory of integration, performance and regression tests.
├── tools Scripts for continuous integration testing.
└── tutorials A set of tutorials about Ignition Transport features.
```

Expand Down
5 changes: 3 additions & 2 deletions example/bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <chrono>
#include <condition_variable>
#include <csignal>
#include <exception>
#include <iostream>
#include <string>
#include <thread>
Expand Down Expand Up @@ -233,7 +234,7 @@ class ReplyTester
std::cerr << "Received[" << _msg.header().stamp().sec()
<< "] Expected[" << this->prevStamp+1 << "]\n";

throw std::unexpected;
std::terminate();
}
}

Expand Down Expand Up @@ -548,7 +549,7 @@ class PubTester
{
std::cerr << "Received[" << _msg.header().stamp().sec()
<< "] Expected[" << this->expectedStamp << "]\n";
throw std::unexpected;
std::terminate();
}
this->expectedStamp++;

Expand Down
3 changes: 2 additions & 1 deletion src/Discovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE

try
{
zmq::poll(&items[0], sizeof(items) / sizeof(items[0]), _timeout);
zmq::poll(&items[0], sizeof(items) / sizeof(items[0]),
std::chrono::milliseconds(_timeout));
}
catch(...)
{
Expand Down
4 changes: 2 additions & 2 deletions src/NodeShared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void NodeShared::RunReceptionTask()
try
{
zmq::poll(&items[0], sizeof(items) / sizeof(items[0]),
NodeSharedPrivate::Timeout);
std::chrono::milliseconds(NodeSharedPrivate::Timeout));
}
catch(...)
{
Expand Down Expand Up @@ -1677,7 +1677,7 @@ void NodeSharedPrivate::AccessControlHandler()
try
{
zmq::poll(&items[0], sizeof(items) / sizeof(items[0]),
NodeSharedPrivate::Timeout);
std::chrono::milliseconds(NodeSharedPrivate::Timeout));
}
catch(...)
{
Expand Down
2 changes: 1 addition & 1 deletion src/NodeSharedPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace ignition
public: std::atomic<bool> exit = false;

/// \brief Timeout used for receiving messages (ms.).
public: static const int Timeout = 250;
public: inline static const int Timeout = 250;

////////////////////////////////////////////////////////////////
/////// The following is for asynchronous publication of ///////
Expand Down
31 changes: 30 additions & 1 deletion tutorials/02_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,36 @@ cd /tmp/ign-transport/build
sudo make uninstall
```

### macOS

1. Clone the repository
```
git clone https://github.com/ignitionrobotics/ign-transport -b ign-transport<#>
```
Be sure to replace `<#>` with a number value, such as 10 or 11, depending on
which version you need.

2. Install dependencies
```
brew install --only-dependencies ignition-transport<#>
```
Be sure to replace `<#>` with a number value, such as 10 or 11, depending on
which version you need.

3. Configure and build
```
cd ign-transport
mkdir build
cd build
cmake ..
make
```

4. Optionally, install
```
sudo make install
```

## Windows

### Prerequisites
Expand Down Expand Up @@ -273,4 +303,3 @@ can run:
```
make test
```

0 comments on commit 0a813ec

Please sign in to comment.