/* * Copyright (c) 2024 Huawei Device Co., Ltd. * 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. * Description: Channel for transmitting data * Author: sunhong * Create: 2022-01-19 */ #ifndef CASTSESSION_CHANNEL_H #define CASTSESSION_CHANNEL_H #include #include "channel_request.h" #include "channel_listener.h" namespace OHOS { namespace CastEngine { namespace CastEngineService { class Channel { public: virtual ~Channel() = default; void SetRequest(const ChannelRequest &request) { channelRequest_ = request; } const ChannelRequest &GetRequest() const { return channelRequest_; } void SetListener(std::shared_ptr listener) { channelListener_ = listener; } std::shared_ptr GetListener() { return channelListener_; } virtual bool Send(const uint8_t *buffer, int length) { return false; } private: ChannelRequest channelRequest_; std::shared_ptr channelListener_; }; } // namespace CastEngineService } // namespace CastEngine } // namespace OHOS #endif // CASTSESSION_CHANNEL_H