Flow-IPC 1.0.2
Flow-IPC project: Full implementation reference.
common.hpp
Go to the documentation of this file.
1/* Flow-IPC: Core
2 * Copyright 2023 Akamai Technologies, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the
5 * "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in
12 * writing, software distributed under the License is
13 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 * CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing
16 * permissions and limitations under the License. */
17
18/// @file
19#pragma once
20
21#include <boost/unordered_map.hpp>
22
23namespace ipc
24{
25
26/// @cond
27// -^- Doxygen, please ignore the following. common.hpp documented the relevant items specially.
28
29/* The following flow::log-recommended trio of #directives begins the necessary flow::log::Component-related
30 * definitions having to do with Flow-IPC's own Component-compatible enumeration. Namely:
31 * - This defines the `enum class Log_component` itself, auto-generated via macro magic.
32 * - This declares (but does not yet populate) an (Log_component -> std::string) multimap containing
33 * each enum value's string representation.
34 * - common.cpp will complete this procedure by populating the map.
35 *
36 * IMPORTANT:
37 * `ipc/detail/macros/log_component_enum_declare.macros.hpp` declares the log components used by all of Flow-IPC
38 * (i.e., by everything in ::ipc namespace). Hence, if enum value X is in that file, then it can be (a)
39 * passed into Log_context ctor; (b) passed into FLOW_LOG_SET_CONTEXT(); (c) potentially seen in per-message
40 * log output; and (d) be used to configure verbosity for messages with component X. */
41
42// This tells the below and certain other boiler-plate macro files the name of the `enum class` being generated.
43#undef FLOW_LOG_CFG_COMPONENT_ENUM_CLASS
44#undef FLOW_LOG_CFG_COMPONENT_ENUM_NAME_MAP
45#define FLOW_LOG_CFG_COMPONENT_ENUM_CLASS Log_component
46/* This tells the below and certain other boiler-plate macro files the name of the enum-to-string multimap that maps
47 * each enum value to its name for log output and config purposes. */
48#define FLOW_LOG_CFG_COMPONENT_ENUM_NAME_MAP S_IPC_LOG_COMPONENT_NAME_MAP
49
50#include <flow/log/macros/config_enum_start_hdr.macros.hpp>
52#include <flow/log/macros/config_enum_end_hdr.macros.hpp>
53
54// -v- Doxygen, please stop ignoring.
55/// @endcond
56
57} // namespace ipc
Catch-all namespace for the Flow-IPC project: A library/API in modern C++17 providing high-performanc...
Definition: common.cpp:22