From d5dc22a0de10ef437fcd4a92cf31e66266d77fc6 Mon Sep 17 00:00:00 2001 From: kinoshitakenta Date: Tue, 30 Apr 2024 14:56:09 +0800 Subject: [PATCH] doc: Adjust code layout and rendering display. --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 71c6551..c779a87 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,7 @@ Current implementation require you to define(override) all the event specific di > > However, it seems dynamic reflection is necessary for implementation, but C++ have no this feature therefore impossible to achieve. -## basic usage - -```c++ +```cpp #include #include @@ -18,8 +16,10 @@ struct AEvent { double speed; // parameter of event }; + struct BEvent {}; + /** * @brief * as an interface for fake module process @@ -37,8 +37,7 @@ class So5_fake_module_process_ev : virtual public Fake_module_process_ev so_5::mbox_t target; public: - So5_fake_module_process_ev(so_5::mbox_t target_) - : target(target_) + So5_fake_module_process_ev(so_5::mbox_t target_) : target(target_) { } @@ -55,12 +54,11 @@ public: } }; -void -fake_module_process(Fake_module_process_ev* evt_li_ptr) +void fake_module_process(Fake_module_process_ev* evt_li_ptr) { - //... + // ... dispatch(evt_li_ptr, a_ev); - //... + // ... } ```