diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2021-08-06 13:50:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 13:50:19 +0200 |
commit | 14ce65525275fa8760fa4f20e10b5a4e5c34ccde (patch) | |
tree | 99c387d8a093b05cc7a89a1fad81514924bdccaa /aclk/schema-wrappers/schema_wrapper_utils.cc | |
parent | 597763dd0ae60dd89af211267a17644e00114537 (diff) |
New Cloud chart related parsers and generators (#11393)
* adds message generators parsers and handlers for upcoming Chart stream implementation
Diffstat (limited to 'aclk/schema-wrappers/schema_wrapper_utils.cc')
-rw-r--r-- | aclk/schema-wrappers/schema_wrapper_utils.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/aclk/schema-wrappers/schema_wrapper_utils.cc b/aclk/schema-wrappers/schema_wrapper_utils.cc new file mode 100644 index 0000000000..b100e20c3b --- /dev/null +++ b/aclk/schema-wrappers/schema_wrapper_utils.cc @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "schema_wrapper_utils.h" + +void set_google_timestamp_from_timeval(struct timeval tv, google::protobuf::Timestamp *ts) +{ + ts->set_nanos(tv.tv_usec*1000); + ts->set_seconds(tv.tv_sec); +} + +void set_timeval_from_google_timestamp(const google::protobuf::Timestamp &ts, struct timeval *tv) +{ + tv->tv_sec = ts.seconds(); + tv->tv_usec = ts.nanos()/1000; +} |