1 /*
2  * Copyright (c) 2024 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 COMMUNICATION_NETMANAGER_BASE_NET_STATS_INFO_SEQUENCE_H
17 #define COMMUNICATION_NETMANAGER_BASE_NET_STATS_INFO_SEQUENCE_H
18 
19 #include "net_stats_info.h"
20 #include "parcel.h"
21 
22 namespace OHOS {
23 namespace NetManagerStandard {
24 #define NET_SYMBOL_VISIBLE_SEQ __attribute__ ((visibility("default")))
25 struct NET_SYMBOL_VISIBLE_SEQ NetStatsInfoSequence final : public Parcelable {
26     uint64_t startTime_ = 0;
27     uint64_t endTime_ = 0;
28     NetStatsInfo info_;
29 
Equalsfinal30     inline bool Equals(const NetStatsInfoSequence &infoSequence) const
31     {
32         return startTime_ == infoSequence.startTime_ && endTime_ == infoSequence.endTime_ &&
33                info_.Equals(infoSequence.info_);
34     }
35 
36     bool Marshalling(Parcel &parcel) const override;
37     static bool Marshalling(Parcel &parcel, const NetStatsInfoSequence &statsSequence);
38     static bool Marshalling(Parcel &parcel, const std::vector<NetStatsInfoSequence> &statsSequence);
39     static bool Unmarshalling(Parcel &parcel, NetStatsInfoSequence &statsSequence);
40     static bool Unmarshalling(Parcel &parcel, std::vector<NetStatsInfoSequence> &statsSequence);
41 };
42 } // namespace NetManagerStandard
43 } // namespace OHOS
44 
45 #endif // COMMUNICATION_NETMANAGER_BASE_NET_STATS_INFO_SEQUENCE_H