File: signal_wrapper_base.cpp

package info (click to toggle)
sigx 2.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,144 kB
  • ctags: 1,311
  • sloc: cpp: 3,103; ansic: 653; xml: 206; python: 65; makefile: 26
file content (60 lines) | stat: -rw-r--r-- 1,980 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * Copyright 2006 Klaus Triendl
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free 
 * Software Foundation, 51 Franklin Street, Fifth Floor, 
 * Boston, MA 02110-1301, USA.
*/

#include "sigx/signal_wrapper_base.h"
#include "sigx/signal_source_base.h"
#include "sigx/tunnel_base.h"
#include "__sigx_pchfence__.h"


namespace sigx
{

signal_wrapper_base::signal_wrapper_base(): 
	m_disp(), 
	m_sigsource()
{}

signal_wrapper_base::signal_wrapper_base(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw(): 
	m_disp(_A_disp), 
	m_sigsource(_A_sigsource)
{}

signal_wrapper_base::~signal_wrapper_base() throw()
{}



std::pair<connection_wrapper, std::tr1::shared_ptr<sigc_connection_ptr> >
signal_wrapper_base::prepare_connection(const tunnel_base& _A_tunnel) const
{
	// prepare a connection pointer;
	// note that the value '0x01' denotes a pending connection request
	std::tr1::shared_ptr<sigc_connection_ptr> refconnptr(new sigc_connection_ptr((sigc_connection_ptr) 0x01));
	const connection_wrapper conn(m_disp, refconnptr);
	// add the connection_wrapper to the validity tracker of the tunnel functor.
	// This enables the validity tracker to disconnect the future slot connected
	// to this signal.
	_A_tunnel.validity_tracker().add_connection(conn);

	return std::make_pair(conn, refconnptr);
}


} // namespace sigx