libuavcan documentation

This commit is contained in:
Pavel Kirienko
2014-07-14 22:22:18 +04:00
parent ee4c191684
commit e5ca1f7379
47 changed files with 1102 additions and 132 deletions
@@ -10,7 +10,11 @@
namespace uavcan
{
/**
* Use this to call member functions as callbacks in C++03 mode.
*
* In C++11 or newer you don't need it because you can use std::function<>/std::bind<> instead.
*/
template <typename ObjectPtr, typename MemFunPtr>
class UAVCAN_EXPORT MethodBinder
{
@@ -36,17 +40,26 @@ public:
, fun_(f)
{ }
/**
* Returns true if the binder is initialized (doesn't contain null pointers).
*/
operator bool() const
{
return try_implicit_cast<bool>(obj_, true) && try_implicit_cast<bool>(fun_, true);
}
/**
* Will raise a fatal error if either method pointer or object pointer are null.
*/
void operator()()
{
validateBeforeCall();
(obj_->*fun_)();
}
/**
* Will raise a fatal error if either method pointer or object pointer are null.
*/
template <typename Par1>
void operator()(Par1& p1)
{
@@ -54,6 +67,9 @@ public:
(obj_->*fun_)(p1);
}
/**
* Will raise a fatal error if either method pointer or object pointer are null.
*/
template <typename Par1, typename Par2>
void operator()(Par1& p1, Par2& p2)
{