Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/SFML/System/ThreadLocalPtr.inl is written in an unsupported language. File is not indexed.

0001 ////////////////////////////////////////////////////////////
0002 //
0003 // SFML - Simple and Fast Multimedia Library
0004 // Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
0005 //
0006 // This software is provided 'as-is', without any express or implied warranty.
0007 // In no event will the authors be held liable for any damages arising from the use of this software.
0008 //
0009 // Permission is granted to anyone to use this software for any purpose,
0010 // including commercial applications, and to alter it and redistribute it freely,
0011 // subject to the following restrictions:
0012 //
0013 // 1. The origin of this software must not be misrepresented;
0014 //    you must not claim that you wrote the original software.
0015 //    If you use this software in a product, an acknowledgment
0016 //    in the product documentation would be appreciated but is not required.
0017 //
0018 // 2. Altered source versions must be plainly marked as such,
0019 //    and must not be misrepresented as being the original software.
0020 //
0021 // 3. This notice may not be removed or altered from any source distribution.
0022 //
0023 ////////////////////////////////////////////////////////////
0024 
0025 
0026 namespace sf
0027 {
0028 ////////////////////////////////////////////////////////////
0029 template <typename T>
0030 ThreadLocalPtr<T>::ThreadLocalPtr(T* value) :
0031 ThreadLocal(value)
0032 {
0033 }
0034 
0035 
0036 ////////////////////////////////////////////////////////////
0037 template <typename T>
0038 T& ThreadLocalPtr<T>::operator *() const
0039 {
0040     return *static_cast<T*>(getValue());
0041 }
0042 
0043 
0044 ////////////////////////////////////////////////////////////
0045 template <typename T>
0046 T* ThreadLocalPtr<T>::operator ->() const
0047 {
0048     return static_cast<T*>(getValue());
0049 }
0050 
0051 
0052 ////////////////////////////////////////////////////////////
0053 template <typename T>
0054 ThreadLocalPtr<T>::operator T*() const
0055 {
0056     return static_cast<T*>(getValue());
0057 }
0058 
0059 
0060 ////////////////////////////////////////////////////////////
0061 template <typename T>
0062 ThreadLocalPtr<T>& ThreadLocalPtr<T>::operator =(T* value)
0063 {
0064     setValue(value);
0065     return *this;
0066 }
0067 
0068 
0069 ////////////////////////////////////////////////////////////
0070 template <typename T>
0071 ThreadLocalPtr<T>& ThreadLocalPtr<T>::operator =(const ThreadLocalPtr<T>& right)
0072 {
0073     setValue(right.getValue());
0074     return *this;
0075 }
0076 
0077 } // namespace sf