+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co.
- *
- * 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
- */
-/**
- * @file channel.h
- * @author Bartlomiej Grzelewski <b.grzelewski@samsung.com>
- * @brief
- */
-#pragma once
-
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <askuser-notification/ask-user-server-channel.h>
-#include <askuser-notification/raw-buffer.h>
-#include <askuser-notification/sock.h>
-
-
-namespace AskUser {
-namespace Protocol {
-
-struct SockDesc {
- SockDesc(Sock psock)
- : sock(std::move(psock))
- {}
- SockDesc(){}
- Sock sock;
- RawBuffer input;
- RawBuffer output;
-};
-
-typedef std::map<int, SockDesc> SocketMap;
-
-class Channel : public IChannel {
-public:
- Channel(ServerCallbacksPtr ptr)
- : m_callbacks(std::move(ptr))
- {}
-
- void init();
- virtual void process(ConnectionFd fd, int mask);
- virtual void popupResponse(ConnectionFd fd, RequestId id, int response);
- virtual ~Channel();
-
-private:
- virtual void parse(const std::string &data, std::vector<std::string> &parsedData);
-
- ServerCallbacksPtr m_callbacks;
- SocketMap m_sockets;
-};
-
-} // namespace Protocol
-} // namespace AskUser
-