sigx++
2.0.1
Main Page
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
sigx
tunnel_context_base.h
Go to the documentation of this file.
1
#ifndef _SIGX_TUNNEL_CONTEXT_BASE_HPP_
2
#define _SIGX_TUNNEL_CONTEXT_BASE_HPP_
3
4
/*
5
* Copyright 2008 Klaus Triendl
6
*
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
11
*
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
16
*
17
* You should have received a copy of the GNU Library General Public
18
* License along with this library; if not, write to the Free
19
* Software Foundation, 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301, USA.
21
*/
22
23
#include <glibmm/thread.h>
24
#include <
sigx/fwddecl.h
>
25
#include <
sigx/bad_dispatcher.h
>
26
#include <
sigx/operator_new.h
>
27
#include <
sigx/shared_dispatchable.h
>
28
#include <
sigx/tunnel_validity_tracker.h
>
29
30
31
namespace
sigx
32
{
33
42
class
SIGX_API
tunnel_context_base
:
public
operator_new
43
{
44
public
:
45
tunnel_context_base
(
const
shared_dispatchable
& _A_disp,
const
tunnel_validity_tracker
& _A_validity_tracker,
bool
sync =
false
);
46
virtual
~
tunnel_context_base
();
47
50
virtual
void
invoke() = 0;
51
52
bool
is_sync
()
const
{
return
m_sync; }
53
bool
is_valid
()
const
{
return
m_validity_tracker.is_valid(); }
54
const
void
*
creator_thread
()
const
{
return
m_creator_thread; }
55
56
protected
:
60
void
dispatch_me();
61
62
protected
:
63
tunnel_validity_tracker
m_validity_tracker
;
64
shared_dispatchable
m_disp
;
65
bool
m_sync
;
66
const
void
*
const
m_creator_thread
;
67
};
68
69
73
class
SIGX_API
sync_tunnel_context_base
:
public
tunnel_context_base
74
{
75
public
:
76
sync_tunnel_context_base
(
const
shared_dispatchable
& _A_disp,
const
tunnel_validity_tracker
& _A_validity_tracker);
77
78
79
protected
:
88
void
dispatch_me();
89
90
91
protected
:
92
Glib::Cond
m_cond
;
93
Glib::Mutex
m_mutex
;
94
};
95
96
97
}
// namespace sigx
98
99
100
#endif // end file guard
Generated on Fri Oct 25 2013 11:35:30 for sigx++ by
1.8.4