Lunchbox  1.12.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
threadID.h
1 
2 /* Copyright (c) 2010-2013, Stefan Eilemann <eile@eyescale.ch>
3  * 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef LUNCHBOX_THREADID_H
20 #define LUNCHBOX_THREADID_H
21 
22 #include <lunchbox/api.h> // LUNCHBOX_API definition
23 #include <lunchbox/compiler.h>
24 
25 #include <ostream>
26 
27 namespace lunchbox
28 {
29 namespace detail { class ThreadID; }
30 
35 class ThreadID
36 {
37 public:
39  LUNCHBOX_API ThreadID();
40 
42  LUNCHBOX_API ThreadID( const ThreadID& from );
43 
45  LUNCHBOX_API ~ThreadID();
46 
48  LUNCHBOX_API ThreadID& operator = ( const ThreadID& from );
49 
51  LUNCHBOX_API bool operator == ( const ThreadID& rhs ) const;
52 
57  LUNCHBOX_API bool operator != ( const ThreadID& rhs ) const;
58 
59 private:
60  detail::ThreadID* const _impl;
61  friend class Thread;
62 
63  friend LUNCHBOX_API
64  std::ostream& operator << ( std::ostream& os, const ThreadID& );
65 };// LB_DEPRECATED;
66 
68 LUNCHBOX_API std::ostream& operator << ( std::ostream&, const ThreadID& );
69 }
70 #endif // LUNCHBOX_THREADID_H
LUNCHBOX_API bool operator!=(const ThreadID &rhs) const
Defines export visibility macros for library Lunchbox.
Utility class to execute code in a separate execution thread.
Definition: thread.h:41
LUNCHBOX_API ThreadID()
Construct a new, zero thread identifier.
An utility class to wrap OS-specific thread identifiers.
Definition: threadID.h:35
friend LUNCHBOX_API std::ostream & operator<<(std::ostream &os, const ThreadID &)
Print the thread to the given output stream.
LUNCHBOX_API ThreadID & operator=(const ThreadID &from)
Assign another thread identifier.
LUNCHBOX_API bool operator==(const ThreadID &rhs) const
Abstraction layer and common utilities for multi-threaded programming.
Definition: algorithm.h:32
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.
Definition: array.h:47
LUNCHBOX_API ~ThreadID()
Destruct this thread identifier.