Skip to content

Commit

Permalink
Merge pull request #119 from Flow-IPC/polish
Browse files Browse the repository at this point in the history
Comment and/or doc changes. / Minor test/demo code fixes. / Minor dead-code removal from build script(s). / Pulls in: [flow] CI pipeline: Tweak to get gcc-13 builds to work again (GitHub changed preinstalled packages).
  • Loading branch information
ygoldfeld authored Dec 11, 2024
2 parents 539bd18 + a6cd87c commit 5efd7cb
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 14 deletions.
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ message(CHECK_START "(Project [${PROJ}] root CMake script executing.)")
list(APPEND CMAKE_MESSAGE_INDENT "- ")

set(PROJ_CAMEL "Ipc")
# TODO: Get it from nearest `VERSION` file perhaps.
set(PROJ_VERSION "1.0.0")
set(PROJ_HUMAN "Flow-IPC")

# The children below rely on this being set and its value to detect they're part of the meta-project,
# as opposed to being loaded separately, and then to load needed things off this place.
# So in *nix setting this indicates to each kid below that they're a part of one big `make`.
# (Whereas otherwise each kid is on its own and assumes the all its dependencies have had `make` and `make install`
# (Whereas otherwise each kid is on its own and assumes all its dependencies have had `make` and `make install`
# done, and the exported stuff is somewhere the `make` will know to search.)
set(FLOW_LIKE_META_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

Expand All @@ -51,7 +49,7 @@ set(FLOW_LIKE_META_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
# - Build tests (from its X/test/{basic|suite}/CMakeLists.txt); can be enabled/disabled via CFG_ x 2.
# - (As of this writing no library to build; though it'd be easy to add it if it made sense.)
# - include(FlowLikeDocGenerate). Same as for each guy above.
# - (This is where we generate the targets for monolithic documentation for all of ipc_* together.
# - (This is where we generate the targets for monolithic documentation for all of ipc_* together.)
#
# Thus, assuming *nix, after going through each bullet above in order, the following is possible:
# - `make`: Makes all the libraries and all the tests (modulo CFG_* enabling/disabling parts).
Expand Down Expand Up @@ -116,7 +114,7 @@ endforeach()
include("${FLOW_LIKE_META_ROOT_flow}/tools/cmake/FlowLikeProject.cmake") # Determine $PROJ_VERSION, at least.
project(${PROJ_CAMEL} VERSION ${PROJ_VERSION} DESCRIPTION ${PROJ_HUMAN} LANGUAGES CXX)

# Got through that; now actually do the add_subdirectory()s. This needs to below the project() call just above.
# Got through that; now actually do the add_subdirectory()s. This needs to be below the project() call just above.
# (Also, output/error handling is crisper this way than doing add_subdirectory() within the above loop.)
foreach(ipc_meta_project ${IPC_META_PROJECTS})
# Finally! Note in the build output the name is normalized to simply ${ipc_meta_project} (e.g., "flow").
Expand Down
2 changes: 1 addition & 1 deletion flow
2 changes: 1 addition & 1 deletion ipc_shm
2 changes: 1 addition & 1 deletion src/doc/manual/b-api_overview.dox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ Further capabilities are outside our scope here; but the main point is: At a min
> shm::capnp_get_shm_handle_to_borrow(msg->body_root().getSomeMsg().getWidgetHandle(), &lend_blob);
>
> auto x = session.borrow_object<Widget>(lend_blob);
> FLOW_LOG_INFO("Hey, let's read inside SHM after receiving SHM-handle: [" << x_borrowed->m_flag << "].");
> FLOW_LOG_INFO("Hey, let's read inside SHM after receiving SHM-handle: [" << x->m_flag << "].");
> // We can write to it too, in most cases.
> x->m_str[0] = 'Y';
> // (Can modify with allocations too, as long as you use an Activator context again, same as in owner process above.)
Expand Down
2 changes: 1 addition & 1 deletion src/doc/manual/f-chan_open.dox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

---

Let's discuss opening channels from within an IPC context (`Session`). learn how to set up your first process-to-process session, from which it is easy to create communication channels. (Or go back to preceding page: @ref session_setup. These two pages are interconnected, as in this context, no pun intended, one uses a `Session` as a source of channel(s).)
Let's discuss opening channels from within an IPC context (`Session`). (Or go back to preceding page: @ref session_setup. These two pages are interconnected, as in this context, no pun intended, one uses a `Session` as a source of channel(s).)

What's a channel? What channel types are supported by ipc::session?
--------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions test/suite/perf_demo/main_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void run_capnp_over_raw(flow::log::Logger* logger_ptr, Channel_raw* chan_ptr)

void on_blob(const Error_code& err_code, size_t sz)
{
if (err_code) { throw Runtime_error(err_code, "run_capnp_over_raw():on_seg_sz()"); }
if (!handle_blob(err_code, sz))
{
read_segs();
Expand All @@ -269,7 +268,7 @@ void run_capnp_over_raw(flow::log::Logger* logger_ptr, Channel_raw* chan_ptr)

bool handle_blob(const Error_code& err_code, size_t sz)
{
if (err_code) { throw Runtime_error(err_code, "run_capnp_over_raw():on_seg_sz()"); }
if (err_code) { throw Runtime_error(err_code, "run_capnp_over_raw():handle_blob()"); }
if (m_new_seg_next)
{
m_new_seg_next = false;
Expand Down

0 comments on commit 5efd7cb

Please sign in to comment.