1 /* 2 * Copyright (c) 2023-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_CAMERA_DPS_COMMAND_H 17 #define OHOS_CAMERA_DPS_COMMAND_H 18 19 #include <cstdint> 20 21 namespace OHOS { 22 namespace CameraStandard { 23 namespace DeferredProcessing { 24 25 #define DECLARE_CMD_CLASS(name) \ 26 public: \ 27 const char* GetCommandName() const override { return #name; } 28 29 class Command { 30 public: 31 Command(); 32 virtual ~Command(); 33 34 /** 35 * @brief Get Command Name 36 * 37 * @return Command Name 38 */ 39 virtual const char* GetCommandName() const = 0; 40 41 /** 42 * @brief Provided for the invocation of Command by the CommandServer, 43 * driving its operation. 44 * 45 * @return The DSP_OK status indicates successful execution of the command, 46 * while other statuses indicate failure. 47 */ 48 int32_t Do(); 49 50 protected: 51 /** 52 * @brief The action executed by Command needs to be overridden by a derived class. 53 * 54 * @return The DSP_OK status indicates successful execution of the command, 55 * while other statuses indicate failure. 56 */ 57 virtual int32_t Executing() = 0; 58 }; 59 } // namespace DeferredProcessing 60 } // namespace CameraStandard 61 } // namespace OHOS 62 #endif // OHOS_CAMERA_DPS_COMMAND_H 63