diff --git a/docs/Messaging/_index.md b/docs/Messaging/_index.md index 6bfb61be..5344a178 100644 --- a/docs/Messaging/_index.md +++ b/docs/Messaging/_index.md @@ -2,3 +2,22 @@ title: "Messaging" weight: 100 --- + +## Headers + +- `message.h` + Defines the core message model. etl::imessage is the base interface (virtual or non-virtual, depending on `ETL_HAS_VIRTUAL_MESSAGES`). `etl::message` provides typed messages with static IDs. Type traits (`is_message`, `is_message_type`, etc.) and ID comparison utilities support compile-time validation. +- `message_router.h` + Defines `etl::imessage_router`, the central routing interface with receive, accepts, and router identity. Provides message_router that statically dispatches by message ID (contiguous IDs optimized). Includes null_message_router and message_producer helpers, plus send_message utilities. +- `message_bus.h` +Implements `etl::imessage_bus`, a router that manages a sorted list of subscribed routers and forwards messages based on destination ID (broadcast or addressed). Supports subscription limits and forwards to successors. +- `message_broker.h` + Implements etl::message_broker, a router with explicit subscription objects mapping routers to message ID lists (span). It routes only to subscribers that match both message ID and destination ID, then forwards to any successor. +- `message_packet.h` + A type-erased, in-place container for a fixed set of message types. Validates message ID acceptance, supports copy/move, and exposes `get()` as `etl::imessage&`. Uses aligned storage sized to the largest message type. +- `shared_message.h` + Reference-counted wrapper around pooled messages (`ireference_counted_message_pool`). Supports copy/move semantics with automatic release when the last reference drops. + +## Basic architecture + +![message-framework](images/message-framework.png) diff --git a/docs/Messaging/images/message-framework.png b/docs/Messaging/images/message-framework.png new file mode 100644 index 00000000..a4b8a424 Binary files /dev/null and b/docs/Messaging/images/message-framework.png differ diff --git a/docs/Messaging/message-broker.md b/docs/Messaging/message-broker.md index f37a89ae..ffc5df6d 100644 --- a/docs/Messaging/message-broker.md +++ b/docs/Messaging/message-broker.md @@ -1,5 +1,6 @@ --- title: "message_broker" +weight: 6 --- {{< callout type="info">}} diff --git a/docs/Messaging/message-bus.md b/docs/Messaging/message-bus.md index ad88030d..5e63eef8 100644 --- a/docs/Messaging/message-bus.md +++ b/docs/Messaging/message-bus.md @@ -1,5 +1,6 @@ --- title: "message_bus" +weight: 5 --- {{< callout type="info">}} diff --git a/docs/Messaging/message-router-registry.md b/docs/Messaging/message-router-registry.md index 79c09fb9..cfd21d1d 100644 --- a/docs/Messaging/message-router-registry.md +++ b/docs/Messaging/message-router-registry.md @@ -1,5 +1,6 @@ --- title: "message_router_registry" +weight: 4 --- {{< callout type="info">}} diff --git a/docs/Messaging/message-router.md b/docs/Messaging/message-router.md index 89d2a91b..7b2c14a2 100644 --- a/docs/Messaging/message-router.md +++ b/docs/Messaging/message-router.md @@ -1,5 +1,6 @@ --- title: message_router +weight: 3 --- A class that will automatically route incoming messages to specific handlers based on the message types declared in the template parameter list. Messages are passed to the receive member function which will static cast it to its real type and call the matching on_receive function in the derived class. A compilation error will occur if the matching on_receive does not exist. @@ -16,7 +17,6 @@ etl::null_message_router Note: This C++03 portion of this header is a generated from `message_router_generator.h`. To handle more than the standard 16 message types then a new one must be generated. See [Generators](./generators-tutorial) - ## Message router ID Allowable router IDs run from `0` to `MAX_MESSAGE_ROUTER` (`249`) inclusive. diff --git a/docs/Messaging/messages.md b/docs/Messaging/message.md similarity index 98% rename from docs/Messaging/messages.md rename to docs/Messaging/message.md index 2a49e91e..5f6efa95 100644 --- a/docs/Messaging/messages.md +++ b/docs/Messaging/message.md @@ -1,5 +1,6 @@ --- -title: "Messages" +title: "message" +weight: 1 --- {{< callout type="info">}} diff --git a/docs/Messaging/shared-message.md b/docs/Messaging/shared-message.md index 8e190308..79ea8a74 100644 --- a/docs/Messaging/shared-message.md +++ b/docs/Messaging/shared-message.md @@ -1,5 +1,6 @@ --- title: "shared_message" +weight: 2 --- {{< callout type="info">}} diff --git a/docs/blog/graphics/dot-and-cross-products.md b/docs/blog/graphics/dot-and-cross-products.md index eaa9ad60..cafcd89d 100644 --- a/docs/blog/graphics/dot-and-cross-products.md +++ b/docs/blog/graphics/dot-and-cross-products.md @@ -11,8 +11,8 @@ If `A` & `B` are vectors, the dot product is `|A||B|cos(θ)`, where `θ` is the `|A|` is the length of the vector `A`. `|B|` is the length of the vector `B`. -Therefore, we can calculate `Cos(θ) = (A ⋅ B)/(|A||B|)`. -A dot product of `0` indicates two perpendicular lines, and that the dot product is greatest when the lines are parallel. +Therefore, we can calculate `cos(θ) = (A ⋅ B)/(|A||B|)`. +A dot product of `0` indicates two perpendicular lines, and the dot product is greatest when the lines are parallel. ## Cross Product @@ -20,3 +20,4 @@ The cross product of vectors `(x1, y1)` and `(x2, y2)` is `x1 * y2 - y1 * x2` If `A` & `B` are vectors, the cross product is `|A||B|sin(θ)`. `|θ|` is the angle between the two vectors, but `θ` can be positive or negative. +Therefore, we can calculate `sin(θ) = (A x B)/(|A||B|)`. \ No newline at end of file