• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2021-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 #ifndef PANDA_TOOLING_PT_VALUE_H
16 #define PANDA_TOOLING_PT_VALUE_H
17 
18 #include <cstdint>
19 #include "libpandabase/macros.h"
20 
21 namespace panda::tooling {
22 // Deprecated API
23 class PtValueMeta {
24 public:
data_(data)25     explicit PtValueMeta(uint64_t data = 0) : data_(data) {}
26 
GetData()27     uint64_t GetData() const
28     {
29         return data_;
30     }
31 
SetData(uint64_t data)32     void SetData(uint64_t data)
33     {
34         data_ = data;
35     }
36 
37     ~PtValueMeta() = default;
38 
39     DEFAULT_COPY_SEMANTIC(PtValueMeta);
40     DEFAULT_MOVE_SEMANTIC(PtValueMeta);
41 
42 private:
43     uint64_t data_;  // Language dependent data
44 };
45 
46 // Deprecated API
47 class PtValue {
48 public:
value_(value)49     explicit PtValue(int64_t value = 0) : value_(value) {}
50 
PtValue(int64_t value,PtValueMeta)51     PtValue(int64_t value, PtValueMeta /* unused */) : value_(value) {}
52 
GetValue()53     int64_t GetValue() const
54     {
55         return value_;
56     }
57 
SetValue(int64_t value)58     void SetValue(int64_t value)
59     {
60         value_ = value;
61     }
62 
63     ~PtValue() = default;
64 
65     DEFAULT_COPY_SEMANTIC(PtValue);
66     DEFAULT_MOVE_SEMANTIC(PtValue);
67 
68 private:
69     int64_t value_;
70 };
71 }  // namespace panda::tooling
72 
73 #endif  // PANDA_TOOLING_PT_VALUE_H
74