doc: Adjust code layout and rendering display.
This commit is contained in:
parent
637ada816f
commit
d5dc22a0de
16
README.md
16
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.
|
> 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);
|
||||||
//...
|
// ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue