Ignition Common

API Reference

3.0.0
detail/SpecializedPlugin.hh File Reference
#include "ignition/common/SpecializedPlugin.hh"
#include <memory>

Go to the source code of this file.

Classes

class  SpecializedPlugin< SpecInterface1, OtherSpecInterfaces... >
 Construct an unbalanced binary tree of specializations by convoluting SpecializedPlugin types using ComposePlugin. More...
 

Namespaces

 ignition
 Forward declarations for the common classes.
 
 ignition::common
 

Macros

#define DETAIL_IGN_COMMON_COMPOSEPLUGIN_DISPATCH(ReturnType, Function, Suffix, CastTo, Args)
 Implement functions whose only roles are to dispatch their functionalities between two base classes, depending on which base is specialized for the template type. This must only be called within the ComposePlugin class. More...
 

Macro Definition Documentation

◆ DETAIL_IGN_COMMON_COMPOSEPLUGIN_DISPATCH

#define DETAIL_IGN_COMMON_COMPOSEPLUGIN_DISPATCH (   ReturnType,
  Function,
  Suffix,
  CastTo,
  Args 
)
Value:
public: /* NOLINT(*) */ \
template <class T> \
ReturnType Function Suffix \
{ \
using Specializer = typename detail::SelectSpecalizerIfAvailable< \
T, Specialization>::Specializer; \
return static_cast<CastTo*>(this)->template Function <T> Args; \
}

Implement functions whose only roles are to dispatch their functionalities between two base classes, depending on which base is specialized for the template type. This must only be called within the ComposePlugin class.

The dispatch is performed by casting this object to the type that specializes for the requested Interface, if such a type is availabe within its inheritance structure. Otherwise, we cast to the generic Plugin type.