Flutter Engine
The Flutter Engine
connection_collection.h
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
5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_CONNECTION_COLLECTION_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_CONNECTION_COLLECTION_H_
7
8#include <cstdint>
9#include <map>
10#include <string>
11
12namespace flutter {
13
14/// Maintains a current integer assigned to a name (connections).
16 public:
17 typedef int64_t Connection;
19
20 Connection AquireConnection(const std::string& name);
21 ///\returns the name of the channel when cleanup is successful, otherwise
22 /// the empty string.
23 std::string CleanupConnection(Connection connection);
24
25 static bool IsValidConnection(Connection connection);
26
27 static Connection MakeErrorConnection(int errCode);
28
29 private:
30 std::map<std::string, Connection> connections_;
31 Connection counter_ = 0;
32};
33
34} // namespace flutter
35
36#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_CONNECTION_COLLECTION_H_
Maintains a current integer assigned to a name (connections).
static const Connection kInvalidConnection
static Connection MakeErrorConnection(int errCode)
std::string CleanupConnection(Connection connection)
Connection AquireConnection(const std::string &name)
static bool IsValidConnection(Connection connection)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32