2 * Copyright (c) 2014 - 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
17 * @file connection-thread.h
18 * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
27 #include <dpl/exception.h>
28 #include <noncopyable.h>
29 #include <client-common.h>
30 #include <async-request.h>
31 #include <descriptor-set.h>
36 class ConnectionThread {
38 DECLARE_EXCEPTION_TYPE(CKM::Exception, EventFdError)
41 virtual ~ConnectionThread();
43 NONCOPYABLE(ConnectionThread);
47 void sendMessage(AsyncRequest &&request);
57 void newRequest(short revents);
59 // reads notification event fd
60 void readEventFd(short revents);
62 Service &getService(const std::string &interface);
64 // Helper class that creates an event fd before thread is started
85 AsyncRequest::Queue m_waitingReqs;
94 std::map<std::string, Service> m_services;
95 DescriptorSet m_descriptors;