a Client that work as a console to send and receive network messages
More...
#include <ConsoleClient.hpp>
|
| ConsoleClient (Context<> &ctx, istream &myCin=cin, ostream &myCout=cout, ostream &myCerr=cerr, string initCmd="") |
| construct More...
|
|
char const * | hmbdcName () const |
|
void | stoppedCb (exception const &e) |
|
void | handleJustBytesCb (uint16_t tag, uint8_t *bytes) |
| callback for JustBytes More...
|
|
void | waitUntilFinish () |
| wait until the console closes
|
|
| Client () |
| trivial constructor
|
|
void | messageDispatchingStartedCb (uint16_t threadSerialNumber) override |
| called before any messages got dispatched - only once More...
|
|
void | stoppedCb (std::exception const &e) override |
| callback called when this Client is taken out of message dispatching More...
|
|
bool | droppedCb () override |
| callback called after the Client is safely taken out of the Context More...
|
|
void | invokedCb (uint16_t threadSerialNumber) override |
| this callback is called all the time (frequently) More...
|
|
char const * | hmbdcName () const |
| return the name of thread that runs this client, override if necessary More...
|
|
std::tuple< char const *, int > | schedSpec () const |
| an overrideable method. returns the schedule policy and priority, override if necessary priority is only used when policy is "SCHED_RR", or "SCHED_FIFO" More...
|
|
size_t | maxBatchMessageCount () const |
| an overridable method. client receives events in batches and the max batch size is controllable when running in direct mode Context. Here is to specify the max size. More...
|
|
void | handleRangeImpl (BufIt &it, BufIt const &end, uint16_t threadSerialNumber) override |
| internal use, don't change or override
|
|
Public Member Functions inherited from hmbdc::app::MessageHandler< ConsoleClient< NetCtx >, Messages... > |
void | handleMessage (MessageHead &w) |
|
| PoolConsumer (bool interestedInMessages=true) |
|
void | stopped (std::exception const &) noexcept |
|
bool | dropped () noexcept |
|
void | messageDispatchingStarted (uint16_t threadId) |
|
void | invoked (uint16_t threadId) |
|
template<typename NetCtx>
struct hmbdc::app::utils::ConsoleClient< NetCtx >
a Client that work as a console to send and receive network messages
a Client that receives all net messages deleived to the process it uses JustBytes to indicate it wants all the messages bytes regardless of their types - still Topic filtering is effective
- Template Parameters
-
template<typename NetCtx >
construct
just construct the Client - need to be run in the Context later
- Parameters
-
ctx | a runtime sized context that the Client will run in |
myCin | for incoming commands |
myCout | for output |
myCerr | for error |
template<typename NetCtx >
callback for JustBytes
it is the user's responsibility to figure ouot the size of the message thru tag and interpret the bytes
- Parameters
-
tag | message tag - starting from 1000 |
bytes | contents of the message - will not exceed the associated Context::maxMessageSize() return value |
template<typename NetCtx >
documentation for all commands the console interprets
commands are seperated by
, when read eof, terminates console
- Returns
- a documentation string
The documentation for this struct was generated from the following file: