doc: Adjust code layout and rendering display.

This commit is contained in:
kinoshitakenta 2024-04-30 14:56:09 +08:00
parent 637ada816f
commit d5dc22a0de
Signed by: kinoshitakenta
GPG Key ID: A811E8CA36EF425E
1 changed files with 7 additions and 9 deletions

View File

@ -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. > However, it seems dynamic reflection is necessary for implementation, but C++ have no this feature therefore impossible to achieve.
## basic usage ```cpp
```c++
#include <event_transformer.h> #include <event_transformer.h>
#include <so_5/all.hpp> #include <so_5/all.hpp>
@ -18,8 +16,10 @@ struct AEvent
{ {
double speed; // parameter of event double speed; // parameter of event
}; };
struct BEvent struct BEvent
{}; {};
/** /**
* @brief * @brief
* as an interface for fake module process * 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; so_5::mbox_t target;
public: public:
So5_fake_module_process_ev(so_5::mbox_t target_) So5_fake_module_process_ev(so_5::mbox_t target_) : target(target_)
: target(target_)
{ {
} }
@ -55,12 +54,11 @@ public:
} }
}; };
void void fake_module_process(Fake_module_process_ev* evt_li_ptr)
fake_module_process(Fake_module_process_ev* evt_li_ptr)
{ {
//... // ...
dispatch(evt_li_ptr, a_ev); dispatch(evt_li_ptr, a_ev);
//... // ...
} }
``` ```