Skip to content

Commit

Permalink
[skinDynLib] Deprecate toVector/fromVector
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Aug 14, 2017
1 parent 9bb9ed1 commit 848c50f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/libraries/skinDynLib/include/iCub/skinDynLib/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,29 @@ inline std::list<unsigned int> vectorofIntEqualto(const std::vector<int> vec, co
return res;
};

/**
* \brief Macro to deprecate functions and methods
*
* see https://blog.samat.io/2017/02/27/Deprecating-functions-and-methods-in-Cplusplus/
*/
// C++14
#if __cplusplus >= 201402L
#if defined(__has_cpp_attribute)
#if __has_cpp_attribute(deprecated)
#define SKINDYNLIB_DEPRECATED(msg) [[deprecated(msg)]]
#endif
#endif
// Earlier standards
#else
#if defined(__GNUC__) || defined(__clang__)
#define SKINDYNLIB_DEPRECATED(msg) __attribute__((deprecated(msg)))
#elif defined(_MSC_VER)
#define SKINDYNLIB_DEPRECATED(msg) __declspec(deprecated(msg))
#else
#define SKINDYNLIB_DEPRECATED(msg)
#endif
#endif

}

}//end namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ class skinContact : public dynContact
* 20-?: list of the id's of the activated taxels;
* ?: pressure;
* @return a Vector representation of this skinContact
* @deprecated This method is deprecated since iCub 1.10, as it is not able to serialize string attribute
* such as linkName and frameName . Please use yarp::os::Portable facilities to serialize this class.
*/
SKINDYNLIB_DEPRECATED("toVector is not able to serialize string attributes such as "
"linkName and frameName. Please use yarp::os::Portable facilities to serialize this class.")
virtual yarp::sig::Vector toVector() const;

/**
Expand All @@ -292,7 +296,11 @@ class skinContact : public dynContact
* ?: pressure;
* @param v the vector to convert into a skinContact
* @return true iff operation succeeded, false otherwise
* @deprecated This method is deprecated since iCub 1.10, as it is not able to serialize string attribute
* such as linkName and frameName . Please use yarp::os::Portable facilities to serialize this class.
*/
SKINDYNLIB_DEPRECATED("fromVector is not able to serialize string attributes such as "
"linkName and frameName. Please use yarp::os::Portable facilities to serialize this class.")
virtual bool fromVector(const yarp::sig::Vector &v);

/**
Expand Down

0 comments on commit 848c50f

Please sign in to comment.