CORESENSE4home_Architecture
Loading...
Searching...
No Matches
macros.hpp File Reference
#include "rclcpp_lifecycle/lifecycle_node.hpp"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/macros.hpp"
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.

Namespaces

namespace  cs4home_core
 

Macros

#define CS_REGISTER_COMPONENT(class_name)
 Macro to define a factory function for creating a shared pointer instance of a component class within the lifecycle node context.
 

Macro Definition Documentation

◆ CS_REGISTER_COMPONENT

#define CS_REGISTER_COMPONENT ( class_name)
Value:
extern "C" class_name::SharedPtr create_instance( \
rclcpp_lifecycle::LifecycleNode::SharedPtr parent) \
{ \
return class_name::make_shared(parent); \
}

Macro to define a factory function for creating a shared pointer instance of a component class within the lifecycle node context.

This macro generates an extern "C" factory function named create_instance that returns a shared pointer to the specified class, allowing dynamic component loading.

Parameters
class_nameThe name of the class to register as a component.