2018-08-21 05:27:52 +00:00
|
|
|
/* Copyright 2017-2018 ccls 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.
|
|
|
|
==============================================================================*/
|
|
|
|
|
2017-12-05 08:14:46 +00:00
|
|
|
#include "message_handler.h"
|
|
|
|
|
2017-12-06 05:03:38 +00:00
|
|
|
namespace {
|
2018-03-22 05:01:21 +00:00
|
|
|
struct In_Exit : public NotificationInMessage {
|
2018-03-22 04:05:25 +00:00
|
|
|
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
2017-12-06 04:39:44 +00:00
|
|
|
};
|
2018-03-22 04:05:25 +00:00
|
|
|
MAKE_REFLECT_EMPTY_STRUCT(In_Exit);
|
|
|
|
REGISTER_IN_MESSAGE(In_Exit);
|
2017-12-06 04:39:44 +00:00
|
|
|
|
2018-03-22 04:05:25 +00:00
|
|
|
struct Handler_Exit : MessageHandler {
|
|
|
|
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
2017-12-05 08:14:46 +00:00
|
|
|
|
2018-08-09 17:08:14 +00:00
|
|
|
void Run(std::unique_ptr<InMessage> request) override { exit(0); }
|
2017-12-05 08:14:46 +00:00
|
|
|
};
|
2018-03-22 04:05:25 +00:00
|
|
|
REGISTER_MESSAGE_HANDLER(Handler_Exit);
|
2018-08-09 17:08:14 +00:00
|
|
|
} // namespace
|