Skip to content

Commit

Permalink
Remove deprecated functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
caguero committed May 9, 2018
1 parent f767253 commit 70d90b8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 391 deletions.
192 changes: 0 additions & 192 deletions include/ignition/transport/Node.hh
Original file line number Diff line number Diff line change
Expand Up @@ -393,38 +393,6 @@ namespace ignition
/// \return true when successfully unsubscribed or false otherwise.
public: bool Unsubscribe(const std::string &_topic);

/// \brief Old method for advertising a service. This signature is
/// considered deprecated. Please migrate to the callback signature
/// \code{bool (*_cb)(const Request &_req, const Reply &_rep)} for
/// advertising a service.
/// \param[in] _topic Topic name associated with the service.
/// \param[in] _cb Callback to handle the service request with the
/// following parameters:
/// \param[in] _req Protobuf message containing the request.
/// \param[out] _rep ProtobufMessage containing the response.
/// \param[out] _result Service call result
/// \param[in] _options Advertise options.
/// \return true when the topic has been successfully advertised or false
/// otherwise.
/// \sa AdvertiseOptions.
/// \deprecated See version where the callback function returns a boolean.
public: template<typename RequestT, typename ReplyT>
IGN_DEPRECATED(4.0) bool Advertise(
const std::string &_topic,
void(*_cb)(const RequestT &_req, ReplyT &_rep, bool &_result),
const AdvertiseServiceOptions &_options = AdvertiseServiceOptions())
{
std::function<bool(const RequestT &, ReplyT&)> newCb =
[=](const RequestT &_internalReq, ReplyT &_internalRep) -> bool
{
bool internalResult = false;
(*_cb)(_internalReq, _internalRep, internalResult);
return internalResult;
};

return this->Advertise(_topic, newCb, _options);
}

/// \brief Advertise a new service.
/// In this version the callback is a plain function pointer.
/// \param[in] _topic Topic name associated to the service.
Expand Down Expand Up @@ -461,36 +429,6 @@ namespace ignition
return this->Advertise(_topic, f, _options);
}

/// \brief Old method for advertising a service. This signature is
/// considered deprecated. Please migrate to the callback signature
/// \code{bool (*_cb)(T &_rep)} for advertising a service.
/// \param[in] _topic Topic name associated to the service.
/// \param[in] _cb Callback to handle the service request with the
/// following parameters:
/// \param[out] _rep Protobuf message containing the response.
/// \param[out] _result Service call result.
/// \param[in] _options Advertise options.
/// \return true when the topic has been successfully advertised or
/// false otherwise.
/// \sa AdvertiseOptions.
/// \deprecated See version where the callback function returns a boolean
public: template<typename ReplyT>
IGN_DEPRECATED(4.0) bool Advertise(
const std::string &_topic,
void(*_cb)(ReplyT &_rep, bool &_result),
const AdvertiseServiceOptions &_options = AdvertiseServiceOptions())
{
std::function<bool(const msgs::Empty &, ReplyT &)> f =
[_cb](const msgs::Empty &/*_internalReq*/, ReplyT &_internalRep)
{
bool internalResult = false;
(*_cb)(_internalRep, internalResult);
return internalResult;
};

return this->Advertise(_topic, f, _options);
}

/// \brief Advertise a new service without input parameter.
/// In this version the callback is a free function.
/// \param[in] _topic Topic name associated to the service.
Expand Down Expand Up @@ -543,39 +481,6 @@ namespace ignition
return this->Advertise(_topic, f, _options);
}

/// \brief Old method for advertising a service. This signature is
/// considered deprecated. Please migrate to the callback signature
/// \code{bool (*_cb)(const T1 &_req, T2 &_rep)} for advertising a
/// service.
/// \param[in] _topic Topic name associated to the service.
/// \param[in] _cb Callback to handle the service request with the
/// following parameters:
/// \param[in] _req Protobuf message containing the request.
/// \param[out] _rep Protobuf message containing the response.
/// \param[out] _result Service call result.
/// \param[in] _options Advertise options.
/// \return true when the topic has been successfully advertised or
/// false otherwise.
/// \sa AdvertiseOptions.
/// \deprecated See version where the callback function returns a boolean
public: template<typename RequestT, typename ReplyT>
IGN_DEPRECATED(4.0) bool Advertise(
const std::string &_topic,
std::function<void(const RequestT &_req,
ReplyT &_rep, bool &_result)> &_cb,
const AdvertiseServiceOptions &_options = AdvertiseServiceOptions())
{
std::function<bool(const RequestT&, ReplyT&)> f =
[_cb](const RequestT &_req, ReplyT &_rep)
{
bool internalResult = false;
(_cb)(_req, _rep, internalResult);
return internalResult;
};

return this->Advertise(_topic, f, _options);
}

/// \brief Advertise a new service.
/// In this version the callback is a lambda function.
/// \param[in] _topic Topic name associated to the service.
Expand Down Expand Up @@ -639,36 +544,6 @@ namespace ignition
return true;
}

/// \brief Old method for advertising a service. This signature is
/// considered deprecated. Please migrate to the callback signature
/// \code{bool (*_cb)(T2 &_rep)} for advertising a service.
/// \param[in] _topic Topic name associated to the service.
/// \param[in] _cb Callback to handle the service request with the
/// following parameters:
/// \param[out] _rep Protobuf message containing the response.
/// \param[out] _result Service call result.
/// \param[in] _options Advertise options.
/// \return true when the topic has been successfully advertised or
/// false otherwise.
/// \sa AdvertiseOptions.
/// \deprecated See version where the callback function returns a boolean
public: template<typename ReplyT>
IGN_DEPRECATED(4.0) bool Advertise(
const std::string &_topic,
std::function<void(ReplyT &_rep, bool &_result)> &_cb,
const AdvertiseServiceOptions &_options = AdvertiseServiceOptions())
{
std::function<bool(const msgs::Empty &, ReplyT &)> f =
[_cb](const msgs::Empty &/*_internalReq*/, ReplyT &_internalRep)
{
bool internalResult = false;
(_cb)(_internalRep, internalResult);
return internalResult;
};

return this->Advertise(_topic, f, _options);
}

/// \brief Advertise a new service without input parameter.
/// In this version the callback is a lambda function.
/// \param[in] _topic Topic name associated to the service.
Expand Down Expand Up @@ -721,41 +596,6 @@ namespace ignition
return this->Advertise(_topic, f, _options);
}

/// \brief Old method for advertising a service. This signature is
/// considered deprecated. Please migrate to the callback signature
/// \code{bool (C::*_cb)(const T1 &_req, T2 &_rep)} for advertising a
/// service.
/// \param[in] _topic Topic name associated to the service.
/// \param[in] _cb Callback to handle the service request with the
/// following parameters:
/// \param[in] _req Protobuf message containing the request.
/// \param[out] _rep Protobuf message containing the response.
/// \param[out] _result Service call result.
/// \param[in] _obj Instance containing the member function.
/// \param[in] _options Advertise options.
/// \return true when the topic has been successfully advertised or
/// false otherwise.
/// \sa AdvertiseOptions.
/// \deprecated See version where the callback function returns a boolean
public: template<typename ClassT, typename RequestT, typename ReplyT>
IGN_DEPRECATED(4.0) bool Advertise(
const std::string &_topic,
void(ClassT::*_cb)(const RequestT &_req, ReplyT &_rep, bool &_result),
ClassT *_obj,
const AdvertiseServiceOptions &_options = AdvertiseServiceOptions())
{
std::function<bool(const RequestT &, ReplyT &)> f =
[_cb, _obj](const RequestT &_internalReq,
ReplyT &_internalRep)
{
bool internalResult;
(_obj->*_cb)(_internalReq, _internalRep, internalResult);
return internalResult;
};

return this->Advertise(_topic, f, _options);
}

/// \brief Advertise a new service.
/// In this version the callback is a member function.
/// \param[in] _topic Topic name associated to the service.
Expand Down Expand Up @@ -786,38 +626,6 @@ namespace ignition
return this->Advertise(_topic, f, _options);
}

/// \brief Old method for advertising a service. This signature is
/// considered deprecated. Please migrate to the callback signature
/// \code{bool (C::*_cb)(T &_rep)} for advertising a service.
/// \param[in] _topic Topic name associated to the service.
/// \param[in] _cb Callback to handle the service request with the
/// following parameters:
/// \param[out] _rep Protobuf message containing the response.
/// \param[out] _result Service call result.
/// \param[in] _obj Instance containing the member function.
/// \param[in] _options Advertise options.
/// \return true when the topic has been successfully advertised or
/// false otherwise.
/// \sa AdvertiseOptions.
/// \deprecated See version where the callback function returns a boolean
public: template<typename ClassT, typename ReplyT>
IGN_DEPRECATED(4.0) bool Advertise(
const std::string &_topic,
void(ClassT::*_cb)(ReplyT &_rep, bool &_result),
ClassT *_obj,
const AdvertiseServiceOptions &_options = AdvertiseServiceOptions())
{
std::function<bool(const msgs::Empty &, ReplyT &)> f =
[_cb, _obj](const msgs::Empty &/*_internalReq*/, ReplyT &_internalRep)
{
bool internalResult;
(_obj->*_cb)(_internalRep, internalResult);
return internalResult;
};

return this->Advertise(_topic, f, _options);
}

/// \brief Advertise a new service without input parameter.
/// In this version the callback is a member function.
/// \param[in] _topic Topic name associated to the service.
Expand Down
Loading

0 comments on commit 70d90b8

Please sign in to comment.