-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.h
More file actions
27 lines (19 loc) · 899 Bytes
/
helpers.h
File metadata and controls
27 lines (19 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// @file
///
/// Helpers used in Horus SDK examples.
#ifndef HORUS_SDK_CPP_EXAMPLES_HELPERS_H_
#define HORUS_SDK_CPP_EXAMPLES_HELPERS_H_
#include "horus/rpc/services.h"
#include "horus/types/span.h"
namespace horus {
/// Parses command line arguments. If a `<host>:<port>` or `<port>` string is given, fills `entry`.
///
/// Invalid arguments will lead to a string being printed to `stderr` and `false` returned.
bool ParseArgs(RpcServices::ServiceResolutionMap::Entry& entry,
Span<const char* const> args) noexcept;
/// Same as `ParseArgs()` above, but accepts multiple entries.
bool ParseArgs(RpcServices::ServiceResolutionMap& entries, Span<const char* const> args) noexcept;
/// Blocks the calling thread until a termination is requested by the user (SIGINT, ctrl-c).
void WaitForTermination() noexcept;
} // namespace horus
#endif // HORUS_SDK_CPP_EXAMPLES_HELPERS_H_