Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Derbasov <[email protected]>
  • Loading branch information
ntfshard committed Feb 15, 2025
1 parent 75b3f72 commit 9f279e8
Show file tree
Hide file tree
Showing 48 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ release will remove the deprecated code.
1. The discovery wire protocol changed to use gz::msgs::Discovery
instead of C-structs. The Packet.hh header file is deprecated, which
contained the Header, SubscriptionMsg, and AdvertiseMessage classes. The
version of the wire protocal has bumped from 9 to 10. This means Gazebo
version of the wire protocol has bumped from 9 to 10. This means Gazebo
Transport 8+ will not work with Gazebo Transport 7 and below.
* [BitBucket pull request 403](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/403)

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN apt-get update \
pkg-config \
cppcheck \
git \
mercurial \
build-essential \
curl \
libprotobuf-dev \
Expand Down Expand Up @@ -41,6 +40,7 @@ RUN /bin/sh -c 'echo "deb [trusted=yes] http://packages.osrfoundation.org/gazebo
libgz-math8-dev \
libgz-msgs11-dev \
libgz-utils3-cli-dev \
libgflags-dev \
&& apt-get clean

USER ubuntu
Expand Down
26 changes: 13 additions & 13 deletions example/bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bool gStop = false;
/// topics. FloodSub and FloodPub can be enabled with the `-f <num>` command
/// line argument. Flooding adds <num> extra publishers and subscribers. The
/// purpose is to "flood" the network with extra messages while performing
/// benchmark analyis.
/// benchmark analysis.
class FloodSub
{
/// \brief Create the subscribers.
Expand Down Expand Up @@ -100,7 +100,7 @@ class FloodSub
/// topics. FloodSub and FloodPub can be enabled with the `-f <num>` command
/// line argument. Flooding adds <num> extra publishers and subscribers. The
/// purpose is to "flood" the network with extra messages while performing
/// benchmark analyis.
/// benchmark analysis.
class FloodPub
{
/// \brief Create a number of publishers.
Expand Down Expand Up @@ -635,7 +635,7 @@ class PubTester
private: std::chrono::time_point<std::chrono::high_resolution_clock> timeEnd;

/// \brief Output filename or empty string for console output.
private: std::string filename = "";
private: std::string filename;

private: int expectedStamp = 0;
};
Expand Down Expand Up @@ -663,16 +663,16 @@ int main(int argc, char **argv)
std::signal(SIGTERM, signalHandler);

// Simple usage.
std::string usage("Benchmark testing program.");
usage += " Usage:\n ./bench <options>\n\n";
usage += " Example intraprocess latency:\n\t./bench -l\n";
usage += " Example interprocess latency:\n";
usage += " \tTerminal 1: ./bench -l -r\n";
usage += " \tTerminal 2: ./bench -l -p\n";
usage += " Example intraprocess throughput:\n\t./bench -t\n";
usage += " Example interprocess throughput:\n";
usage += " \tTerminal 1: ./bench -t -r\n";
usage += " \tTerminal 2: ./bench -t -p\n";
std::string usage = "Benchmark testing program."
" Usage:\n ./bench <options>\n\n"
" Example intraprocess latency:\n\t./bench -l\n"
" Example interprocess latency:\n"
" \tTerminal 1: ./bench -l -r\n"
" \tTerminal 2: ./bench -l -p\n"
" Example intraprocess throughput:\n\t./bench -t\n"
" Example interprocess throughput:\n"
" \tTerminal 1: ./bench -t -r\n"
" \tTerminal 2: ./bench -t -p\n";

gflags::SetUsageMessage(usage);

Expand Down
2 changes: 1 addition & 1 deletion example/record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main(int argc, char *argv[])
const int64_t addTopicResult = recorder.AddTopic(std::regex(".*"));
if (addTopicResult < 0)
{
std::cerr << "An error occured when trying to add topics: "
std::cerr << "An error occurred when trying to add topics: "
<< addTopicResult << "\n";
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/Clock.hh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace gz
private: WallClock();

/// \brief Destructor
private: ~WallClock() override;
public: ~WallClock() override;

/// \internal Implementation of this class
private: class Implementation;
Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/Discovery.hh
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ namespace gz
this->mcastAddr.sin_port = htons(static_cast<u_short>(this->port));

std::vector<std::string> relays;
std::string gzRelay = "";
std::string gzRelay;
if (env("GZ_RELAY", gzRelay) && !gzRelay.empty())
{
relays = transport::split(gzRelay, ':');
Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/NetUtils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace gz
/// \brief Determine your login name.
/// \return Name used to gain access to the computer.
/// On linux and Mac only, if determination
/// of your login name failes then a string of the form "error-UUID"
/// of your login name fails then a string of the form "error-UUID"
/// is returned where UUID is a universally unique identifier.
std::string GZ_TRANSPORT_VISIBLE username();
}
Expand Down
22 changes: 11 additions & 11 deletions include/gz/transport/Node.hh
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace gz
/// \param[in] _options Advertise options.
/// \return A PublisherId, which can be used in Node::Publish calls.
/// The PublisherId also acts as boolean, where true occurs if the topic
/// was succesfully advertised.
/// was successfully advertised.
/// \sa AdvertiseOptions.
public: template<typename MessageT>
Node::Publisher Advertise(
Expand All @@ -229,7 +229,7 @@ namespace gz
/// \param[in] _options Advertise options.
/// \return A PublisherId, which can be used in Node::Publish calls.
/// The PublisherId also acts as boolean, where true occurs if the topic
/// was succesfully advertised.
/// was successfully advertised.
/// \sa AdvertiseOptions.
public: Node::Publisher Advertise(
const std::string &_topic,
Expand Down Expand Up @@ -257,7 +257,7 @@ namespace gz

/// \brief Subscribe to a topic registering a callback.
/// Note that this callback does not include any message information.
/// In this version the callback is a lamda function.
/// In this version the callback is a lambda function.
/// \param[in] _topic Topic to be subscribed.
/// \param[in] _callback Lambda function with the following parameters:
/// * _msg Protobuf message containing a new topic update.
Expand Down Expand Up @@ -304,7 +304,7 @@ namespace gz

/// \brief Subscribe to a topic registering a callback.
/// Note that this callback includes message information.
/// In this version the callback is a lamda function.
/// In this version the callback is a lambda function.
/// \param[in] _topic Topic to be subscribed.
/// \param[in] _callback Lambda function with the following parameters:
/// * _msg Protobuf message containing a new topic update.
Expand Down Expand Up @@ -523,7 +523,7 @@ namespace gz
/// * _reply Protobuf message containing the response.
/// * _result Result of the service call. If false, there was
/// a problem executing your request.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename RequestT, typename ReplyT>
bool Request(
const std::string &_topic,
Expand All @@ -539,7 +539,7 @@ namespace gz
/// * _reply Protobuf message containing the response.
/// * _result Result of the service call. If false, there was
/// a problem executing your request.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename ReplyT>
bool Request(
const std::string &_topic,
Expand All @@ -555,7 +555,7 @@ namespace gz
/// * _reply Protobuf message containing the response.
/// * _result Result of the service call. If false, there was
/// a problem executing your request.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename RequestT, typename ReplyT>
bool Request(
const std::string &_topic,
Expand All @@ -572,7 +572,7 @@ namespace gz
/// * _reply Protobuf message containing the response.
/// * _result Result of the service call. If false, there was
/// a problem executing your request.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename ReplyT>
bool Request(
const std::string &_topic,
Expand All @@ -590,7 +590,7 @@ namespace gz
/// * _result Result of the service call. If false, there was
/// a problem executing your request.
/// \param[in] _obj Instance containing the member function.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename ClassT, typename RequestT, typename ReplyT>
bool Request(
const std::string &_topic,
Expand All @@ -608,7 +608,7 @@ namespace gz
/// * _result Result of the service call. If false, there was
/// a problem executing your request.
/// \param[in] _obj Instance containing the member function.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename ClassT, typename ReplyT>
bool Request(
const std::string &_topic,
Expand Down Expand Up @@ -651,7 +651,7 @@ namespace gz
/// \param[in] _topic Topic requested.
/// \param[in] _request Protobuf message containing the request's
/// parameters.
/// \return true when the service call was succesfully requested.
/// \return true when the service call was successfully requested.
public: template<typename RequestT>
bool Request(const std::string &_topic, const RequestT &_request);

Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/NodeShared.hh
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ namespace gz
protected: NodeShared();

/// \brief Destructor.
protected: virtual ~NodeShared();
public: virtual ~NodeShared();

/// \brief Initialize all sockets.
/// \return True when success or false otherwise. This function might
Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/RepHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ namespace gz
private: std::shared_ptr<Req> CreateMsg(const std::string &_data) const
{
// Instantiate a specific protobuf message
std::shared_ptr<Req> msgPtr(new Req());
auto msgPtr = std::make_shared<Req>();

// Create the message using some serialized data
if (!msgPtr->ParseFromString(_data))
Expand Down
12 changes: 6 additions & 6 deletions include/gz/transport/ReqHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ namespace gz

/// \brief When there is a blocking service call request, the call can
/// be unlocked when a service call REP is available. This variable
/// captures if we have found a node that can satisty our request.
/// captures if we have found a node that can satisfy our request.
public: bool repAvailable;
};

Expand All @@ -201,7 +201,7 @@ namespace gz
public: std::shared_ptr<Rep> CreateMsg(const std::string &_data) const
{
// Instantiate a specific protobuf message
std::shared_ptr<Rep> msgPtr(new Rep());
auto msgPtr = std::make_shared<Rep>();

// Create the message using some serialized data
if (!msgPtr->ParseFromString(_data))
Expand All @@ -225,7 +225,7 @@ namespace gz
}

/// \brief Set the REQ protobuf message for this handler.
/// \param[in] _reqMsg Protofub message containing the input parameters of
/// \param[in] _reqMsg Protobuf message containing the input parameters of
/// of the service request.
public: void SetMessage(const Req *_reqMsg)
{
Expand All @@ -241,7 +241,7 @@ namespace gz
/// \brief This function is only used for compatibility with
/// SetResponse() when [REP = google::protobuf::Message].
/// It shouldn't do anything.
/// \param[in] _repMsg Protofub message containing the variable where
/// \param[in] _repMsg Protobuf message containing the variable where
/// the result will be stored.
public: void SetResponse(const Rep *_repMsg)
{
Expand Down Expand Up @@ -319,7 +319,7 @@ namespace gz
}

/// \brief Set the REQ protobuf message for this handler.
/// \param[in] _reqMsg Protofub message containing the input parameters of
/// \param[in] _reqMsg Protobuf message containing the input parameters of
/// of the service request.
public: void SetMessage(const google::protobuf::Message *_reqMsg)
{
Expand All @@ -334,7 +334,7 @@ namespace gz
}

/// \brief Set the REP protobuf message for this handler.
/// \param[in] _repMsg Protofub message containing the variable where
/// \param[in] _repMsg Protobuf message containing the variable where
/// the result will be stored. The only purpose of this function is to
/// store the type information of _repMsg.
public: void SetResponse(const google::protobuf::Message *_repMsg)
Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/TopicUtils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace gz
/// \<TOPIC\>: The topic name. A trailing slash will always be removed.
///
/// Note: Intuitively, you can imagine the fully qualified name as a
/// UNIX absolute path, where the partition is always sorrounded by "@".
/// UNIX absolute path, where the partition is always surrounded by "@".
/// A namespace, if present, corresponds with the directories of the
/// path, and you can imagine the topic as the filename.
///
Expand Down
4 changes: 2 additions & 2 deletions include/gz/transport/TransportTypes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace gz
/// \brief Map that stores all generic publishers.
/// The keys are the process uuids of the nodes. For each uuid key, the
/// value contains the list of publishers advertising the topic within the
/// same proccess uuid.
/// same process uuid.
template<typename T>
using Addresses_M = std::map<std::string, std::vector<T>>;

Expand Down Expand Up @@ -174,7 +174,7 @@ namespace gz
/// \brief The string type used for generic messages.
const std::string kGenericMessageType = "google.protobuf.Message";

/// \brief The high water mark of the recieve message buffer.
/// \brief The high water mark of the receive message buffer.
/// \sa NodeShared::RcvHwm
const int kDefaultRcvHwm = 1000;

Expand Down
2 changes: 1 addition & 1 deletion log/include/gz/transport/log/Batch.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace gz
/// \param[in] _old the instance being moved into this one
public: Batch(Batch &&_old); // NOLINT

/// \brief Move assignement operator
/// \brief Move assignment operator
/// \param[in] _other the new Batch replacing the current one
/// \return The updated Batch instance.
public: Batch& operator=(Batch &&_other); // NOLINT
Expand Down
2 changes: 1 addition & 1 deletion log/include/gz/transport/log/Message.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace gz

/// \brief Construct with data.
/// \internal
/// Referrences and pointers are borrowed, and must be kept alive by
/// References and pointers are borrowed, and must be kept alive by
/// the creator for as long as an instance lives.
/// This constructor is public for the sake of unit testing, but is not
/// expected to be called by a user.
Expand Down
2 changes: 1 addition & 1 deletion log/include/gz/transport/log/MsgIter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace gz
/// \return false if the two iterator point to the same message
public: bool operator!=(const MsgIter &_other) const;

/// \brief Move assignement operator
/// \brief Move assignment operator
/// \param[in] _other the new iterator replacing the current one
/// \return The updated MsgIter.
public: MsgIter& operator=(MsgIter &&_other); // NOLINT
Expand Down
2 changes: 1 addition & 1 deletion log/include/gz/transport/log/Playback.hh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace gz
/// In most cases there should be no issue, but if you or a library you
/// are using calls sqlite3_config(~) to change the threading mode to
/// Single-thread or Multi-thread (instead of the default setting of
/// Seralized), then starting multiple simultaneous playbacks from the
/// Serialized), then starting multiple simultaneous playbacks from the
/// same log file could be dangerous.
///
/// \return A handle for managing the playback of the log. You must hold
Expand Down
2 changes: 1 addition & 1 deletion log/include/gz/transport/log/QualifiedTime.hh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace gz
/// std::chrono::seconds(value)
/// std::chrono::milliseconds(value)
/// std::chrono::minutes(value)
/// // ... ect ...
/// // ... etc ...
/// \endcode
///
/// into any function that accepts this Time type.
Expand Down
2 changes: 1 addition & 1 deletion log/include/gz/transport/log/SqlStatement.hh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace gz
/// nullptr if it does not contain a REAL value.
public: const double *QueryReal() const;

/// \brief Get the text value of this paramter.
/// \brief Get the text value of this parameter.
/// \return A pointer to this parameter's text string, or a nullptr if
/// it does not contain a text string.
public: const std::string *QueryText() const;
Expand Down
2 changes: 1 addition & 1 deletion log/src/BatchPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class gz::transport::log::BatchPrivate
{
/// \brief constructor
/// \param[in] _db an open sqlite3 database handle wrapper
/// \param[in] _statements a list of statments to be executed to get messages
/// \param[in] _statements a list of statements to be executed to get messages
public: explicit BatchPrivate(
const std::shared_ptr<raii_sqlite3::Database> &_db,
std::vector<SqlStatement> &&_statements); // NOLINT(build/c++11)
Expand Down
Loading

0 comments on commit 9f279e8

Please sign in to comment.