Goby3 3.4.0
2026.04.13
Loading...
Searching...
No Matches
static_group_names.h
Go to the documentation of this file.
1// Copyright 2012-2026:
2// GobySoft, LLC (2013-)
3// Massachusetts Institute of Technology (2007-2014)
4// Community contributors (see AUTHORS file)
5// File authors:
6// Toby Schneider <toby@gobysoft.org>
7//
8//
9// This file is part of the Goby Underwater Autonomy Project Libraries
10// ("The Goby Libraries").
11//
12// The Goby Libraries are free software: you can redistribute them and/or modify
13// them under the terms of the GNU Lesser General Public License as published by
14// the Free Software Foundation, either version 2.1 of the License, or
15// (at your option) any later version.
16//
17// The Goby Libraries are distributed in the hope that they will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU Lesser General Public License for more details.
21//
22// You should have received a copy of the GNU Lesser General Public License
23// along with Goby. If not, see <http://www.gnu.org/licenses/>.
24
25#ifndef GOBY_MIDDLEWARE_TRANSPORT_DETAIL_STATIC_GROUP_NAMES_H
26#define GOBY_MIDDLEWARE_TRANSPORT_DETAIL_STATIC_GROUP_NAMES_H
27
28#include <array>
29
31{
32
33// helper for concatenating prefix to group name
34template <std::size_t N1, std::size_t N2>
35constexpr auto concat(const char (&a)[N1], const char (&b)[N2])
36{
37 std::array<char, N1 + N2 - 1> out{};
38 for (std::size_t i = 0; i < N1 - 1; ++i) out[i] = a[i];
39 for (std::size_t i = 0; i < N2; ++i) out[i + N1 - 1] = b[i];
40 return out;
41}
42
43} // namespace goby::middleware::detail
44
45#endif
constexpr auto concat(const char(&a)[N1], const char(&b)[N2])