Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1085)

Unified Diff: mojo/edk/system/ports/name.h

Issue 1585493002: [mojo] Ports EDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/edk/system/ports/name.h
diff --git a/mojo/edk/system/ports/name.h b/mojo/edk/system/ports/name.h
new file mode 100644
index 0000000000000000000000000000000000000000..b0ad0b71c825eff67b4d5c290f5a3d41eb73f209
--- /dev/null
+++ b/mojo/edk/system/ports/name.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_SYSTEM_PORTS_NAME_H_
+#define MOJO_EDK_SYSTEM_PORTS_NAME_H_
+
+#include <stdint.h>
+
+#include <ostream>
+
+namespace mojo {
+namespace edk {
+namespace ports {
+
+struct Name {
+ Name(uint64_t v1, uint64_t v2) : v1(v1), v2(v2) {}
+ uint64_t v1, v2;
+};
+
+inline bool operator==(const Name& a, const Name& b) {
+ return a.v1 == b.v1 && a.v2 == b.v2;
+}
+inline bool operator!=(const Name& a, const Name& b) {
+ return !(a == b);
+}
+std::ostream& operator<<(std::ostream& stream, const Name& name);
+
+struct PortName : Name {
+ PortName() : Name(0, 0) {}
+ PortName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
+};
+
+const PortName kInvalidPortName = {0, 0};
+
+struct NodeName : Name {
+ NodeName() : Name(0, 0) {}
+ NodeName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
+};
+
+const NodeName kInvalidNodeName = {0, 0};
+
+} // namespace ports
+} // namespace edk
+} // namespace mojo
+
+#endif // MOJO_EDK_SYSTEM_PORTS_NAME_H_

Powered by Google App Engine
This is Rietveld 408576698