1 /* 2 * Copyright (c) 2021 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 #ifndef PLUGIN_SERVICE_STUB_H 16 #define PLUGIN_SERVICE_STUB_H 17 18 #include "plugin_service.h" 19 20 #ifdef USE_PLUGIN_SERVICE_STUB 21 class PluginServiceStub { 22 public: 23 static std::shared_ptr<PluginServiceStub> GetInstance(); 24 25 void SetCreateResult(bool value); 26 bool GetCreateResult() const; 27 28 void SetStartResult(bool value); 29 bool GetStartResult() const; 30 31 void SetStopResult(bool value); 32 bool GetStopResult() const; 33 34 void SetDestroyResult(bool value); 35 bool GetDestroyResult() const; 36 37 void SetAddResult(bool value); 38 bool GetAddResult(); 39 40 void SetRemoveResult(bool value); 41 bool GetRemoveResult(); 42 43 PluginServiceStub() = default; 44 ~PluginServiceStub() = default; 45 46 private: 47 bool createResult_ = true; 48 bool destroyResult_ = true; 49 bool startResult_ = true; 50 bool stopResult_ = true; 51 bool addResult_ = true; 52 bool removeResult_ = true; 53 TraceFileWriterPtr traceWriter_ = nullptr; 54 }; 55 #endif 56 57 #endif // !PLUGIN_SERVICE_STUB_H