Line data Source code
1 : /** 2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd. 3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of 4 : * CANN Open Software License Agreement Version 2.0 (the "License"). 5 : * Please refer to the License for details. You may not use this file except in compliance with the License. 6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 8 : * See LICENSE in the root of the software repository for the full text of the License. 9 : */ 10 : 11 : #ifndef QUEUE_PROCESS_HOST_H 12 : #define QUEUE_PROCESS_HOST_H 13 : 14 : #include <map> 15 : #include <string> 16 : #include "queue_process.h" 17 : 18 : namespace acl { 19 : class QueueProcessorHost : public QueueProcessor { 20 : public: 21 : aclError acltdtCreateQueue(const acltdtQueueAttr *const attr, uint32_t *const qid) override; 22 : 23 : aclError acltdtDestroyQueue(const uint32_t qid) override; 24 : 25 : aclError acltdtBindQueueRoutes(acltdtQueueRouteList *const qRouteList) override; 26 : 27 : aclError acltdtUnbindQueueRoutes(acltdtQueueRouteList *const qRouteList) override; 28 : 29 : aclError acltdtQueryQueueRoutes(const acltdtQueueRouteQueryInfo *const queryInfo, 30 : acltdtQueueRouteList *const qRouteList) override; 31 : 32 : aclError acltdtEnqueue(const uint32_t qid, const acltdtBuf buf, const int32_t timeout) override; 33 : 34 : aclError acltdtDequeue(const uint32_t qid, acltdtBuf *const buf, const int32_t timeout) override; 35 : 36 : aclError acltdtAllocBuf(const size_t size, const uint32_t type, acltdtBuf *const buf) override; 37 : 38 : aclError acltdtFreeBuf(acltdtBuf buf) override; 39 : 40 : aclError acltdtSetBufDataLen(const acltdtBuf buf, const size_t len) override; 41 : 42 : aclError acltdtGetBufDataLen(const acltdtBuf buf, size_t *const len) override; 43 : 44 : aclError acltdtAppendBufChain(const acltdtBuf headBuf, const acltdtBuf buf) override; 45 : 46 : aclError acltdtGetBufChainNum(const acltdtBuf headBuf, uint32_t *const num) override; 47 : 48 : aclError acltdtGetBufFromChain(const acltdtBuf headBuf, const uint32_t index, acltdtBuf *const buf) override; 49 : 50 : aclError acltdtGetBufData(const acltdtBuf buf, void **const dataPtr, size_t *const size) override; 51 : 52 : aclError acltdtGetBufUserData(const acltdtBuf buf, void *dataPtr, 53 : const size_t size, const size_t offset) override; 54 : 55 : aclError acltdtSetBufUserData(acltdtBuf buf, const void *dataPtr, 56 : const size_t size, const size_t offset) override; 57 : 58 : aclError acltdtCopyBufRef(const acltdtBuf buf, acltdtBuf *const newBuf) override; 59 : 60 : aclError SendBindUnbindMsg(const int32_t deviceId, acltdtQueueRouteList *const qRouteList, 61 : const bool isBind, rtEschedEventSummary_t &eventSum, rtEschedEventReply_t &ack) const; 62 : 63 : aclError QueryQueueRoutes(const int32_t deviceId, const acltdtQueueRouteQueryInfo *const queryInfo, 64 : const size_t routeNum, rtEschedEventSummary_t &eventSum, 65 : rtEschedEventReply_t &ack, acltdtQueueRouteList *const qRouteList) const; 66 : 67 14 : QueueProcessorHost() = default; 68 15 : ~QueueProcessorHost() override = default; 69 : 70 : // not allow copy constructor and assignment operators 71 : QueueProcessorHost(const QueueProcessorHost &) = delete; 72 : 73 : QueueProcessorHost &operator=(const QueueProcessorHost &) = delete; 74 : 75 : QueueProcessorHost(QueueProcessorHost &&) = delete; 76 : 77 : QueueProcessorHost &&operator=(QueueProcessorHost &&) = delete; 78 : }; 79 : } 80 : 81 : #endif // QUEUE_PROCESS_HOST_H