Flutter iOS Embedder
connection_collection.mm
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
8 
10 
11 namespace flutter {
13  Connection nextConnection = ++counter_;
14  connections_[name] = nextConnection;
15  return nextConnection;
16 }
17 
19  if (connection > 0) {
20  std::string channel;
21  for (auto& keyValue : connections_) {
22  if (keyValue.second == connection) {
23  channel = keyValue.first;
24  break;
25  }
26  }
27  if (channel.length() > 0) {
28  connections_.erase(channel);
29  return channel;
30  }
31  }
32  return "";
33 }
34 
36  return connection > 0;
37 }
38 
40  if (errCode < 0) {
41  return -1 * errCode;
42  }
43  return errCode;
44 }
45 
46 } // namespace flutter
static Connection MakeErrorConnection(int errCode)
std::string CleanupConnection(Connection connection)
Connection AquireConnection(const std::string &name)
static bool IsValidConnection(Connection connection)