diff --git a/hdc/service/examples/sample.h b/hdc/service/examples/sample.h new file mode 100644 index 0000000000000000000000000000000000000000..3737e95e6555557e8d2d0451b19c44c3eb20d066 --- /dev/null +++ b/hdc/service/examples/sample.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021 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. + */ +#ifndef EXAM_H +#define EXAM_H + +#include +#include +#include +#include + +using std::string; + +namespace OHOS { +namespace Example { +class Basic { +public: + std::string basicName; +public: + int getBasicId() + { + return this->basicId; + } +private: + int basicId; +}; + +class Human : public Basic { +public: + bool getOpFlag() + { + return this->opFlag; + } +public: + int age = 0; +private: + bool opFlag; +} + +struct Book { + int getCc() + { + return this->cc; + } +public: + int aa; +private: + int cc; +} + +/** + * @brief service服务,提供IPC调用接口 + * @ServiceClass + */ +class Exam2 { +public: + Book getBook(Basic& basic); + int fun1 (Book v1); + int fun2 (Basic& basic, Human& human); +}; +} // namespace Example +} // namespace OHOS +#endif // EXAM_H