/* * Tencent is pleased to support the open source community by making ScriptX available. * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include namespace script { template Global::Global() noexcept : val_() {} template Global::Global(const script::Local& localReference) {} template Global::Global(const script::Weak& weak) {} template Global::Global(const script::Global& copy) : val_(copy.val_) {} template Global::Global(script::Global&& move) noexcept : val_(move.val_) {} template Global::~Global() {} template Global& Global::operator=(const script::Global& assign) { Global(assign).swap(*this); return *this; } template Global& Global::operator=(script::Global&& move) noexcept { Global(std::move(move)).swap(*this); return *this; } template void Global::swap(Global& rhs) noexcept {} template Global& Global::operator=(const script::Local& assign) { *this = Global(assign); return *this; } template Local Global::get() const { TEMPLATE_NOT_IMPLEMENTED(); } template Local Global::getValue() const { TEMPLATE_NOT_IMPLEMENTED(); } template bool Global::isEmpty() const { return false; } template void Global::reset() {} // == Weak == template Weak::Weak() noexcept : val_() {} template Weak::~Weak() {} template Weak::Weak(const script::Local& localReference) {} template Weak::Weak(const script::Global& globalReference) {} template Weak::Weak(const script::Weak& copy) : val_(copy.val_) {} template Weak::Weak(script::Weak&& move) noexcept : val_(std::move(move.val_)) {} template Weak& Weak::operator=(const script::Weak& assign) { val_ = assign.val_; return *this; } template Weak& Weak::operator=(script::Weak&& move) noexcept { val_ = std::move(move.val_); return *this; } template void Weak::swap(Weak& rhs) noexcept { std::swap(val_, rhs.val_); } template Weak& Weak::operator=(const script::Local& assign) { *this = Weak(assign); return *this; } template Local Weak::get() const { if (isEmpty()) throw Exception("get on empty Weak"); TEMPLATE_NOT_IMPLEMENTED(); } template Local Weak::getValue() const { TEMPLATE_NOT_IMPLEMENTED(); } template bool Weak::isEmpty() const { return false; } template void Weak::reset() noexcept {} } // namespace script