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 INCLUDE_REJECT_MOVABLE_H 17 #define INCLUDE_REJECT_MOVABLE_H 18 19 namespace OHOS { 20 namespace NetManagerStandard { 21 class NonCopyable { 22 protected: 23 constexpr NonCopyable() = default; 24 ~NonCopyable() = default; 25 26 NonCopyable(NonCopyable &&) = default; 27 NonCopyable &operator=(NonCopyable &&) = default; 28 29 private: 30 NonCopyable(const NonCopyable &) = delete; 31 void operator=(const NonCopyable &) = delete; 32 }; 33 34 class RejectMovable { 35 protected: 36 constexpr RejectMovable() = default; 37 ~RejectMovable() = default; 38 39 RejectMovable(const RejectMovable &) = default; 40 RejectMovable &operator=(const RejectMovable &) = default; 41 42 private: 43 RejectMovable(RejectMovable &&) = delete; 44 void operator=(RejectMovable &&) = delete; 45 }; 46 } // namespace NetManagerStandard 47 } // namespace OHOS 48 #endif // INCLUDE_REJECT_MOVABLE_H 49