/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file nodePointerTo.I * @author drose * @date 2005-05-07 */ #ifndef CPPPARSER /** * */ template INLINE NodePointerTo:: NodePointerTo(To *ptr) : NodePointerToBase(ptr) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodePointerTo:: NodePointerTo(const NodePointerTo ©) : NodePointerToBase((const NodePointerToBase &)copy) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodePointerTo:: NodePointerTo(NodePointerTo &&from) noexcept : NodePointerToBase((NodePointerToBase &&)from) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodePointerTo &NodePointerTo:: operator = (NodePointerTo &&from) noexcept { this->reassign(std::move(from)); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE typename NodePointerTo::To &NodePointerTo:: operator *() const { return *((To *)(this->_void_ptr)); } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE typename NodePointerTo::To *NodePointerTo:: operator -> () const { return (To *)(this->_void_ptr); } #endif // CPPPARSER #ifndef CPPPARSER /** * We also have the typecast operator to automatically convert NodePointerTo's * to the required kind of actual pointer. This introduces ambiguities which * the compiler will resolve one way or the other, but we don't care which way * it goes because either will be correct. */ template INLINE NodePointerTo:: operator T *() const { return (To *)(this->_void_ptr); } #endif // CPPPARSER #ifndef CPPPARSER /** * Returns an ordinary pointer instead of a NodePointerTo. Useful to work * around compiler problems, particularly for implicit upcasts. */ template INLINE typename NodePointerTo::To *NodePointerTo:: p() const { return (To *)(this->_void_ptr); } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodePointerTo &NodePointerTo:: operator = (To *ptr) { this->reassign(ptr); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodePointerTo &NodePointerTo:: operator = (const NodePointerTo ©) { this->reassign((const NodePointerToBase &)copy); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo:: NodeConstPointerTo(const typename NodeConstPointerTo::To *ptr) : NodePointerToBase((typename NodeConstPointerTo::To *)ptr) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo:: NodeConstPointerTo(const NodePointerTo ©) : NodePointerToBase((const NodePointerToBase &)copy) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo:: NodeConstPointerTo(const NodeConstPointerTo ©) : NodePointerToBase((const NodePointerToBase &)copy) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo:: NodeConstPointerTo(NodePointerTo &&from) noexcept : NodePointerToBase((NodePointerToBase &&)from) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo:: NodeConstPointerTo(NodeConstPointerTo &&from) noexcept : NodePointerToBase((NodePointerToBase &&)from) { } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: operator = (NodePointerTo &&from) noexcept { this->reassign(std::move(from)); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: operator = (NodeConstPointerTo &&from) noexcept { this->reassign(std::move(from)); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE const typename NodeConstPointerTo::To &NodeConstPointerTo:: operator *() const { return *((To *)(this->_void_ptr)); } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE const typename NodeConstPointerTo::To *NodeConstPointerTo:: operator -> () const { return (To *)(this->_void_ptr); } #endif // CPPPARSER #ifndef CPPPARSER /** * We also have the typecast operator to automatically convert * NodeConstPointerTo's to the required kind of actual pointer. This * introduces ambiguities which the compiler will resolve one way or the * other, but we don't care which way it goes because either will be correct. */ template INLINE NodeConstPointerTo:: operator const T * () const { return (To *)(this->_void_ptr); } #endif // CPPPARSER #ifndef CPPPARSER /** * Returns an ordinary pointer instead of a NodeConstPointerTo. Useful to * work around compiler problems, particularly for implicit upcasts. */ template INLINE const typename NodeConstPointerTo::To *NodeConstPointerTo:: p() const { return (To *)(this->_void_ptr); } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: operator = (const To *ptr) { this->reassign((To *)ptr); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: operator = (const NodePointerTo ©) { this->reassign((const NodePointerToBase &)copy); return *this; } #endif // CPPPARSER #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: operator = (const NodeConstPointerTo ©) { this->reassign((const NodePointerToBase &)copy); return *this; } #endif // CPPPARSER