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 16 #ifndef OHOS_AAFWK_INTERFACES_INNERKITS_CONFIGURATION_H 17 #define OHOS_AAFWK_INTERFACES_INNERKITS_CONFIGURATION_H 18 19 #include <string> 20 21 #include "nocopyable.h" 22 #include "parcel.h" 23 24 namespace OHOS { 25 namespace AAFwk { 26 27 class DummyConfiguration : public Parcelable { 28 public: 29 DummyConfiguration() = default; 30 explicit DummyConfiguration(const std::string &name); 31 virtual ~DummyConfiguration() = default; 32 33 /** 34 * @brief Obtains the name of the Configuration. 35 * 36 * @return Returns the Configuration name. 37 */ GetName()38 inline const std::string &GetName() const 39 { 40 return testInfostr_; 41 } 42 43 unsigned int Differ(const std::shared_ptr<DummyConfiguration> config) const; 44 45 /** 46 * @brief read this Sequenceable object from a Parcel. 47 * 48 * @param inParcel Indicates the Parcel object into which the Sequenceable object has been marshaled. 49 * @return Returns true if read successed; returns false otherwise. 50 */ 51 bool ReadFromParcel(Parcel &parcel); 52 53 /** 54 * @brief Marshals this Sequenceable object into a Parcel. 55 * 56 * @param outParcel Indicates the Parcel object to which the Sequenceable object will be marshaled. 57 */ 58 virtual bool Marshalling(Parcel &parcel) const override; 59 60 /** 61 * @brief Unmarshals this Sequenceable object from a Parcel. 62 * 63 * @param inParcel Indicates the Parcel object into which the Sequenceable object has been marshaled. 64 */ 65 static DummyConfiguration *Unmarshalling(Parcel &parcel); 66 67 private: 68 std::string testInfostr_; 69 }; 70 71 } // namespace AAFwk 72 } // namespace OHOS 73 #endif // OHOS_AAFWK_INTERFACES_INNERKITS_CONFIGURATION_H