Lunchbox  1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
threadID.h
1 
2 /* Copyright (c) 2010-2015, Stefan Eilemann <eile@eyescale.ch>
3  * 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
30 {
31 class ThreadID;
32 }
33 
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 
60  bool operator<(const ThreadID& rhs) const;
61 
62 private:
63  detail::ThreadID* const _impl;
64  friend class Thread;
65 
66  friend LUNCHBOX_API std::ostream& operator<<(std::ostream& os,
67  const ThreadID&);
68 };
69 
71 LUNCHBOX_API std::ostream& operator<<(std::ostream&, const ThreadID&);
72 }
73 #endif // LUNCHBOX_THREADID_H
Defines export visibility macros for library Lunchbox.
Utility class to execute code in a separate execution thread.
Definition: thread.h:44
An utility class to wrap OS-specific thread identifiers.
Definition: threadID.h:35
Abstraction layer and common utilities for multi-threaded programming.
Definition: algorithm.h:29
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.
Definition: array.h:59