Lunchbox  1.6.0
threadID.h
00001 
00002 /* Copyright (c) 2010-2012, Stefan Eilemann <eile@eyescale.ch>
00003  *                    2012, Daniel Nachbaur <danielnachbaur@gmail.com>
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License version 2.1 as published
00007  * by the Free Software Foundation.
00008  *  
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00012  * details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00017  */
00018 
00019 #ifndef LUNCHBOX_THREADID_H
00020 #define LUNCHBOX_THREADID_H
00021 
00022 #include <lunchbox/api.h>     // LUNCHBOX_API definition
00023 
00024 #include <ostream>
00025 
00026 namespace lunchbox
00027 {
00028 namespace detail { class ThreadID; }
00029 
00031     class ThreadID
00032     {
00033     public:
00035         LUNCHBOX_API ThreadID();
00036 
00038         LUNCHBOX_API ThreadID( const ThreadID& from );
00039 
00041         LUNCHBOX_API ~ThreadID();
00042 
00044         LUNCHBOX_API ThreadID& operator = ( const ThreadID& from );
00045 
00047         LUNCHBOX_API bool operator == ( const ThreadID& rhs ) const;
00048 
00053         LUNCHBOX_API bool operator != ( const ThreadID& rhs ) const;
00054         
00055         LUNCHBOX_API static const ThreadID ZERO; 
00056 
00057     private:
00058         detail::ThreadID* const _impl;
00059         friend class Thread;
00060 
00061         friend LUNCHBOX_API 
00062         std::ostream& operator << ( std::ostream& os, const ThreadID& );
00063     };
00064 
00066     LUNCHBOX_API std::ostream& operator << ( std::ostream&, const ThreadID& );
00067 }
00068 #endif // LUNCHBOX_THREADID_H