rclcpp  master
C++ ROS Client Library API
Macros
macros.hpp File Reference
#include <memory>
#include <utility>
Include dependency graph for macros.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RCLCPP_DISABLE_COPY(...)
 
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
 
#define RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(...)
 
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
 
#define __RCLCPP_SHARED_PTR_ALIAS(...)
 
#define __RCLCPP_MAKE_SHARED_DEFINITION(...)
 
#define RCLCPP_SHARED_PTR_DEFINITIONS(...)
 Defines aliases and static functions for using the Class with shared_ptrs. More...
 
#define __RCLCPP_WEAK_PTR_ALIAS(...)
 
#define RCLCPP_WEAK_PTR_DEFINITIONS(...)   __RCLCPP_WEAK_PTR_ALIAS(__VA_ARGS__)
 Defines aliases and static functions for using the Class with weak_ptrs. More...
 
#define __RCLCPP_UNIQUE_PTR_ALIAS(...)   using UniquePtr = std::unique_ptr<__VA_ARGS__>;
 
#define __RCLCPP_MAKE_UNIQUE_DEFINITION(...)
 
#define RCLCPP_UNIQUE_PTR_DEFINITIONS(...)
 Defines aliases and static functions for using the Class with unique_ptrs. More...
 
#define RCLCPP_STRING_JOIN(arg1, arg2)   RCLCPP_DO_STRING_JOIN(arg1, arg2)
 
#define RCLCPP_DO_STRING_JOIN(arg1, arg2)   arg1 ## arg2
 

Macro Definition Documentation

◆ RCLCPP_DISABLE_COPY

#define RCLCPP_DISABLE_COPY (   ...)
Value:
__VA_ARGS__(const __VA_ARGS__ &) = delete; \
__VA_ARGS__ & operator=(const __VA_ARGS__ &) = delete;

Disables the copy constructor and operator= for the given class.

Use in the private section of the class.

◆ RCLCPP_SMART_PTR_DEFINITIONS

#define RCLCPP_SMART_PTR_DEFINITIONS (   ...)
Value:
RCLCPP_WEAK_PTR_DEFINITIONS(__VA_ARGS__) \
RCLCPP_UNIQUE_PTR_DEFINITIONS(__VA_ARGS__)
#define RCLCPP_SHARED_PTR_DEFINITIONS(...)
Defines aliases and static functions for using the Class with shared_ptrs.
Definition: macros.hpp:84

Defines aliases and static functions for using the Class with smart pointers.

Use in the public section of the class. Make sure to include <memory> in the header when using this.

◆ RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE

#define RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE (   ...)
Value:
RCLCPP_WEAK_PTR_DEFINITIONS(__VA_ARGS__) \
__RCLCPP_UNIQUE_PTR_ALIAS(__VA_ARGS__)
#define RCLCPP_SHARED_PTR_DEFINITIONS(...)
Defines aliases and static functions for using the Class with shared_ptrs.
Definition: macros.hpp:84

Defines aliases and static functions for using the Class with smart pointers.

Same as RCLCPP_SMART_PTR_DEFINITIONS except it excludes the static Class::make_unique() method definition which does not work on classes which are not CopyConstructable.

Use in the public section of the class. Make sure to include <memory> in the header when using this.

◆ RCLCPP_SMART_PTR_ALIASES_ONLY

#define RCLCPP_SMART_PTR_ALIASES_ONLY (   ...)
Value:
__RCLCPP_WEAK_PTR_ALIAS(__VA_ARGS__) \
__RCLCPP_MAKE_SHARED_DEFINITION(__VA_ARGS__)
#define __RCLCPP_SHARED_PTR_ALIAS(...)
Definition: macros.hpp:71

Defines aliases only for using the Class with smart pointers.

Same as RCLCPP_SMART_PTR_DEFINITIONS except it excludes the static method definitions which do not work on pure virtual classes and classes which are not CopyConstructable.

Use in the public section of the class. Make sure to include <memory> in the header when using this.

◆ __RCLCPP_SHARED_PTR_ALIAS

#define __RCLCPP_SHARED_PTR_ALIAS (   ...)
Value:

◆ __RCLCPP_MAKE_SHARED_DEFINITION

#define __RCLCPP_MAKE_SHARED_DEFINITION (   ...)
Value:
template<typename ... Args> \
make_shared(Args && ... args) \
{ \
return std::make_shared<__VA_ARGS__>(std::forward<Args>(args) ...); \
}

◆ RCLCPP_SHARED_PTR_DEFINITIONS

#define RCLCPP_SHARED_PTR_DEFINITIONS (   ...)
Value:
__RCLCPP_MAKE_SHARED_DEFINITION(__VA_ARGS__)
#define __RCLCPP_SHARED_PTR_ALIAS(...)
Definition: macros.hpp:71

Defines aliases and static functions for using the Class with shared_ptrs.

◆ __RCLCPP_WEAK_PTR_ALIAS

#define __RCLCPP_WEAK_PTR_ALIAS (   ...)
Value:

◆ RCLCPP_WEAK_PTR_DEFINITIONS

#define RCLCPP_WEAK_PTR_DEFINITIONS (   ...)    __RCLCPP_WEAK_PTR_ALIAS(__VA_ARGS__)

Defines aliases and static functions for using the Class with weak_ptrs.

◆ __RCLCPP_UNIQUE_PTR_ALIAS

#define __RCLCPP_UNIQUE_PTR_ALIAS (   ...)    using UniquePtr = std::unique_ptr<__VA_ARGS__>;

◆ __RCLCPP_MAKE_UNIQUE_DEFINITION

#define __RCLCPP_MAKE_UNIQUE_DEFINITION (   ...)
Value:
template<typename ... Args> \
make_unique(Args && ... args) \
{ \
return std::unique_ptr<__VA_ARGS__>(new __VA_ARGS__(std::forward<Args>(args) ...)); \
}

◆ RCLCPP_UNIQUE_PTR_DEFINITIONS

#define RCLCPP_UNIQUE_PTR_DEFINITIONS (   ...)
Value:
__RCLCPP_MAKE_UNIQUE_DEFINITION(__VA_ARGS__)
#define __RCLCPP_UNIQUE_PTR_ALIAS(...)
Definition: macros.hpp:95

Defines aliases and static functions for using the Class with unique_ptrs.

◆ RCLCPP_STRING_JOIN

#define RCLCPP_STRING_JOIN (   arg1,
  arg2 
)    RCLCPP_DO_STRING_JOIN(arg1, arg2)

◆ RCLCPP_DO_STRING_JOIN

#define RCLCPP_DO_STRING_JOIN (   arg1,
  arg2 
)    arg1 ## arg2