sigx++  2.0.1
request_f.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* Do not edit! -- generated file */
3 
4 
5 #ifndef _SIGXMACROS_REQUEST_F_H_
6 #define _SIGXMACROS_REQUEST_F_H_
7 
8 
9 /*
10  * Copyright 2007 Klaus Triendl
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26 
27 #include <sigc++/slot.h>
28 #include <sigx/noncopyable.h>
31 #include <sigx/internal_types.h>
32 #include <sigx/static_assert.h>
33 
34 
35 namespace sigx
36 {
37 
91 template<typename T_arg1 = sigc::nil, typename T_arg2 = sigc::nil, typename T_arg3 = sigc::nil, typename T_arg4 = sigc::nil, typename T_arg5 = sigc::nil, typename T_arg6 = sigc::nil, typename T_arg7 = sigc::nil>
92 class request_f: noncopyable, nonheapallocatable, nonpointeraliasing, protected sigc::slot<void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7>
93 {
94 public:
95  typedef sigc::slot<void,T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> parent_type;
96 
97  // allow function operator to be used
98  using parent_type::operator ();
99 
109  template<typename T_functor>
110  explicit request_f(const T_functor& _A_func):
111  parent_type(tunnel_functor<ASYNC, T_functor>(_A_func))
112  {
113  // passed in functor must not be tunneled
115 
116  // passed in functor must not be a slot or adapt a slot;
117  // we have to apply this restriction because slots might have bound
118  // trackables that can cause non-threadsafe access to the passed in slot
119  // which will live in the context of the server thread
121  }
122 };
123 
124 
125 } // namespace sigx
126 #endif /* _SIGXMACROS_REQUEST_F_H_ */
finds out whether T_functor is tunneled, i.e. whether the functor chain contains a functor derived fr...
Definition: internal_types.h:99
finds out whether T_functor is tunneled, i.e. whether the functor chain contains a functor derived fr...
Definition: internal_types.h:176
Private operator new and delete ensure derived classes cannot be created with new on the heap...
Definition: nonheapallocatable.h:35
Asynchronous request functor for a sigx::threadable.
Definition: request_f.h:92
Definition: tunnel_functor.h:44
Private address operator (operator &) ensures that the address of derived objects can't be taken...
Definition: nonpointeraliasing.h:34
Definition: types.h:38
sigc::slot< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > parent_type
Definition: request_f.h:95
request_f(const T_functor &_A_func)
Constructs the request functor.
Definition: request_f.h:110
#define SIGX_STATIC_ASSERT(expr)
Definition: static_assert.h:53
Private copy constructor and copy assignment ensure derived classes cannot be copied.
Definition: noncopyable.h:37