1 /*
2  * Copyright (c) 2022 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_MEMORY_MEMMGR_INNERKITS_BUNDLE_PRIORITY_LIST_H
17 #define OHOS_MEMORY_MEMMGR_INNERKITS_BUNDLE_PRIORITY_LIST_H
18 
19 #include "bundle_priority.h"
20 #include "parcel.h"
21 
22 namespace OHOS {
23 namespace Memory {
24 class BundlePriorityList : public Parcelable {
25 public:
26     /**
27      * @brief Marshals a purpose into a parcel.
28      *
29      * @param parcel Indicates the parcel object for marshalling.
30      * @return True if success, else false.
31      */
32     bool Marshalling(Parcel &parcel) const;
33     static BundlePriorityList *Unmarshalling(Parcel &parcel);
34 
35     int32_t GetCount() const;
36     void SetCount(int32_t count);
37     const std::vector<BundlePriority>& GetList();
38     int32_t Size() const;
39     void AddBundleInfo(BundlePriority &bundleInfo);
40     void Show() const;
41 private:
42     bool ReadFromParcel(Parcel &parcel);
43 
44     int32_t count_ {0};
45     std::vector<BundlePriority> list_;
46 };
47 } // namespace Memory
48 } // namespace OHOS
49 #endif // OHOS_MEMORY_MEMMGR_INNERKITS_BUNDLE_PRIORITY_LIST_H
50