LibreOffice
LibreOffice 4.1 SDK C/C++ API Reference
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
salhelper
thread.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*/
9
10
#ifndef INCLUDED_SALHELPER_THREAD_HXX
11
#define INCLUDED_SALHELPER_THREAD_HXX
12
13
#include "
sal/config.h
"
14
15
#include <cstddef>
16
17
#include "
osl/thread.hxx
"
18
#include "
sal/types.h
"
19
#include "
salhelper/salhelperdllapi.h
"
20
#include "
salhelper/simplereferenceobject.hxx
"
21
22
namespace
salhelper {
23
29
class
SALHELPER_DLLPUBLIC
Thread
:
30
public
salhelper::SimpleReferenceObject
,
private
osl::Thread
31
{
32
public
:
37
Thread
(
char
const
* name);
38
49
void
launch();
50
51
using
osl::Thread::getIdentifier
;
52
using
osl::Thread::join
;
53
using
osl::Thread::schedule
;
54
using
osl::Thread::terminate
;
55
56
// While the below static member functions should arguably always be called
57
// with qualified (osl::Thread) names, compilers would still complain that
58
// they are inaccessible from within derivations of salhelper::Thread (an
59
// alternative would be to force such derivations to use global names,
60
// prefixed with ::osl::Thread):
61
using
osl::Thread::getCurrentIdentifier
;
62
using
osl::Thread::wait
;
63
using
osl::Thread::yield
;
64
65
static
inline
void
*
operator
new
(std::size_t size)
66
{
return
SimpleReferenceObject::operator
new
(size); }
67
68
static
inline
void
operator
delete
(
void
* pointer)
69
{ SimpleReferenceObject::operator
delete
(pointer); }
70
71
protected
:
72
virtual
~
Thread
();
73
79
virtual
void
execute() = 0;
80
81
private
:
82
virtual
void
SAL_CALL run();
83
84
virtual
void
SAL_CALL onTerminated();
85
86
char
const
* name_;
87
};
88
89
}
90
91
#endif
92
93
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Generated on Thu Aug 29 2013 01:06:40 for LibreOffice by
1.8.4