#[macro_export]
macro_rules! define_action {
(
$action_struct:ident,
action_name: $action_name:expr,
Goal: $goal_type:ty,
Result: $result_type:ty,
Feedback: $feedback_type:ty $(,)?
) => {
impl $crate::action::ZAction for $action_struct {
type Goal = $goal_type;
type Result = $result_type;
type Feedback = $feedback_type;
fn name() -> &'static str {
$action_name
}
}
impl $crate::msg::ZMessage for $goal_type
where
$goal_type: Send + Sync + 'static,
{
type Serdes = $crate::msg::SerdeCdrSerdes<$goal_type>;
}
impl $crate::msg::ZMessage for $result_type
where
$result_type: Send + Sync + 'static,
{
type Serdes = $crate::msg::SerdeCdrSerdes<$result_type>;
}
impl $crate::msg::ZMessage for $feedback_type
where
$feedback_type: Send + Sync + 'static,
{
type Serdes = $crate::msg::SerdeCdrSerdes<$feedback_type>;
}
};
}