From 86bdc2d44045a701ead9f44e6b7dfa974038196e Mon Sep 17 00:00:00 2001 From: Guantao Liu Date: Fri, 20 Sep 2019 18:23:40 -0700 Subject: [PATCH 1/4] Add base classes of EventManagerInterface. --- BUILD | 9 +++++++++ src/core/lib/iomgr/eventmanager_interface.h | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/core/lib/iomgr/eventmanager_interface.h diff --git a/BUILD b/BUILD index 9a4c85b26e0..63025ce8cd6 100644 --- a/BUILD +++ b/BUILD @@ -2519,3 +2519,12 @@ filegroup( ], visibility = ["//visibility:public"], ) + +# Base classes of EventManagerInterface + +grpc_cc_library( + name = "eventmanager_interface", + hdrs = [ + "src/core/lib/iomgr/poller/eventmanager_interface.h", + ], +) diff --git a/src/core/lib/iomgr/eventmanager_interface.h b/src/core/lib/iomgr/eventmanager_interface.h new file mode 100644 index 00000000000..bf7514f83b6 --- /dev/null +++ b/src/core/lib/iomgr/eventmanager_interface.h @@ -0,0 +1,18 @@ +#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ +#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ + +namespace grpc { + +namespace experimental { + +class BaseEventManagerInterface { + public: + virtual ~BaseEventManagerInterface() {} +}; + +class EpollEventManagerInterface : public BaseEventManagerInterface {}; + +} // namespace experimental +} // namespace grpc + +#endif // GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ From e10b3b650bdc08b4b0c1b3daebe5bb95b3aad4ad Mon Sep 17 00:00:00 2001 From: Guantao Liu Date: Mon, 23 Sep 2019 13:56:45 -0700 Subject: [PATCH 2/4] Add copyright and fix include guards. --- src/core/lib/iomgr/eventmanager_interface.h | 18 ---------- .../lib/iomgr/poller/eventmanager_interface.h | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 18 deletions(-) delete mode 100644 src/core/lib/iomgr/eventmanager_interface.h create mode 100644 src/core/lib/iomgr/poller/eventmanager_interface.h diff --git a/src/core/lib/iomgr/eventmanager_interface.h b/src/core/lib/iomgr/eventmanager_interface.h deleted file mode 100644 index bf7514f83b6..00000000000 --- a/src/core/lib/iomgr/eventmanager_interface.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ -#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ - -namespace grpc { - -namespace experimental { - -class BaseEventManagerInterface { - public: - virtual ~BaseEventManagerInterface() {} -}; - -class EpollEventManagerInterface : public BaseEventManagerInterface {}; - -} // namespace experimental -} // namespace grpc - -#endif // GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ diff --git a/src/core/lib/iomgr/poller/eventmanager_interface.h b/src/core/lib/iomgr/poller/eventmanager_interface.h new file mode 100644 index 00000000000..6cfe1fddfdd --- /dev/null +++ b/src/core/lib/iomgr/poller/eventmanager_interface.h @@ -0,0 +1,36 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ +#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ + +namespace grpc { + +namespace experimental { + +class BaseEventManagerInterface { + public: + virtual ~BaseEventManagerInterface() {} +}; + +class EpollEventManagerInterface : public BaseEventManagerInterface {}; + +} // namespace experimental +} // namespace grpc + +#endif // GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ From ed5eb7eae770adfa1965a34f3f828f25072590c4 Mon Sep 17 00:00:00 2001 From: Guantao Liu Date: Mon, 23 Sep 2019 15:13:33 -0700 Subject: [PATCH 3/4] Remove redundant blank lines. --- BUILD | 1 - src/core/lib/iomgr/poller/eventmanager_interface.h | 1 - 2 files changed, 2 deletions(-) diff --git a/BUILD b/BUILD index 4163f03fa7f..b6554eb71ef 100644 --- a/BUILD +++ b/BUILD @@ -2523,7 +2523,6 @@ filegroup( ) # Base classes of EventManagerInterface - grpc_cc_library( name = "eventmanager_interface", hdrs = [ diff --git a/src/core/lib/iomgr/poller/eventmanager_interface.h b/src/core/lib/iomgr/poller/eventmanager_interface.h index 6cfe1fddfdd..95359a3db07 100644 --- a/src/core/lib/iomgr/poller/eventmanager_interface.h +++ b/src/core/lib/iomgr/poller/eventmanager_interface.h @@ -20,7 +20,6 @@ #define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ namespace grpc { - namespace experimental { class BaseEventManagerInterface { From e61e086bc0bfbbef40944e8559056d3157413165 Mon Sep 17 00:00:00 2001 From: Guantao Liu Date: Mon, 23 Sep 2019 17:39:37 -0700 Subject: [PATCH 4/4] Fix include guards. --- src/core/lib/iomgr/poller/eventmanager_interface.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/lib/iomgr/poller/eventmanager_interface.h b/src/core/lib/iomgr/poller/eventmanager_interface.h index 95359a3db07..b4fbaeb7bbb 100644 --- a/src/core/lib/iomgr/poller/eventmanager_interface.h +++ b/src/core/lib/iomgr/poller/eventmanager_interface.h @@ -16,8 +16,8 @@ * */ -#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ -#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ +#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H +#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H namespace grpc { namespace experimental { @@ -32,4 +32,4 @@ class EpollEventManagerInterface : public BaseEventManagerInterface {}; } // namespace experimental } // namespace grpc -#endif // GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H_ +#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H */