Goby3 3.4.0
2026.04.13
Loading...
Searching...
No Matches
group.h File Reference
#include <cstdint>
#include <limits>
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  goby::middleware::Group
 Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS, "channel" in LCM, or "variable" in MOOS. More...
 
class  goby::middleware::DynamicGroup
 Implementation of Group for dynamic (run-time) instantiations. Use Group directly for static (compile-time) instantiations. More...
 

Namespaces

namespace  goby
 The global namespace for the Goby project.
 
namespace  goby::middleware
 Objects implementing the Goby nested middleware.
 
namespace  std
 STL namespace.
 

Macros

#define GOBY_DEFINE_GROUP(QNAME, NAME)
 Macro to define a goby::middleware::Group variable in a given namespace.
 
#define GOBY_DEFINE_INTERVEHICLE_GROUP(QNAME, NAME, NUMERIC)
 Macro to define a goby::middleware::Group variable with a numeric value in a given namespace.
 

Functions

bool goby::middleware::operator== (const Group &a, const Group &b)
 
bool goby::middleware::operator!= (const Group &a, const Group &b)
 
std::ostream & goby::middleware::operator<< (std::ostream &os, const Group &g)
 

Macro Definition Documentation

◆ GOBY_DEFINE_GROUP

#define GOBY_DEFINE_GROUP (   QNAME,
  NAME 
)
Value:
namespace QNAME \
{ \
constexpr goby::middleware::Group NAME{#QNAME "::" #NAME}; \
}
Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS,...
Definition group.h:60

Macro to define a goby::middleware::Group variable in a given namespace.

This is a convenience macro for defining a constexpr goby::middleware::Group. The group's string value is automatically set to the fully-qualified name "<QNAME>::<NAME>", matching the C++ qualified name of the variable. Requires C++17 or later (uses nested namespace definitions).

Example usage:

GOBY_DEFINE_GROUP(foo::groups, mygrp)
// equivalent to:
// namespace foo::groups {
// constexpr goby::middleware::Group mygrp{"foo::groups::mygrp"};
// }
#define GOBY_DEFINE_GROUP(QNAME, NAME)
Macro to define a goby::middleware::Group variable in a given namespace.
Definition group.h:165

Definition at line 165 of file group.h.

◆ GOBY_DEFINE_INTERVEHICLE_GROUP

#define GOBY_DEFINE_INTERVEHICLE_GROUP (   QNAME,
  NAME,
  NUMERIC 
)
Value:
namespace QNAME \
{ \
constexpr goby::middleware::Group NAME{#QNAME "::" #NAME, static_cast<std::uint32_t>(NUMERIC)}; \
}

Macro to define a goby::middleware::Group variable with a numeric value in a given namespace.

This is a convenience macro for defining a constexpr goby::middleware::Group with both a string and a numeric value, suitable for use on intervehicle and outer layers. The group's string value is automatically set to the fully-qualified name "<QNAME>::<NAME>", matching the C++ qualified name of the variable. Requires C++17 or later (uses nested namespace definitions).

Example usage:

// equivalent to:
// namespace groups::nav {
// constexpr goby::middleware::Group nav{"groups::nav::nav", goby::middleware::Group::broadcast_group};
// }
static constexpr std::uint32_t broadcast_group
Special group number representing the broadcast group (used when no grouping is required for a given ...
Definition group.h:63
#define GOBY_DEFINE_INTERVEHICLE_GROUP(QNAME, NAME, NUMERIC)
Macro to define a goby::middleware::Group variable with a numeric value in a given namespace.
Definition group.h:187

Definition at line 187 of file group.h.