CARLA
Metadata.h
Go to the documentation of this file.
1 // Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
9 #include "carla/MsgPack.h"
10 
11 namespace carla {
12 namespace rpc {
13 
14  /// Metadata of an RPC function call.
15  class Metadata {
16  public:
17 
18  Metadata() = default;
19 
20  static Metadata MakeSync() {
21  return { false };
22  }
23 
24  static Metadata MakeAsync() {
25  return { true };
26  }
27 
28  bool IsResponseIgnored() const {
29  return _asynchronous_call;
30  }
31 
32  private:
33 
34  Metadata(bool asynchronous_call) : _asynchronous_call(asynchronous_call) {}
35 
36  bool _asynchronous_call = false;
37 
38  public:
39 
40  MSGPACK_DEFINE_ARRAY(_asynchronous_call);
41  };
42 
43 } // namespace rpc
44 } // namespace carla
static Metadata MakeSync()
Definition: Metadata.h:20
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
bool IsResponseIgnored() const
Definition: Metadata.h:28
Metadata(bool asynchronous_call)
Definition: Metadata.h:34
Metadata of an RPC function call.
Definition: Metadata.h:15
MSGPACK_DEFINE_ARRAY(_asynchronous_call)
static Metadata MakeAsync()
Definition: Metadata.h:24