aGrUM  0.14.2
signaler0_tpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
29 // To help IDE parsers
31 
32 namespace gum {
33  namespace __sig__ {
34 
35  template < class TargetClass >
36  Connector0< TargetClass >::Connector0() {
37  GUM_CONSTRUCTOR(Connector0);
38  __target = nullptr;
39  __action = nullptr;
40  }
41 
42  template < class TargetClass >
43  Connector0< TargetClass >::Connector0(
44  TargetClass* target, void (TargetClass::*action)(const void*)) {
45  GUM_CONSTRUCTOR(Connector0);
46  __target = target;
47  __action = action;
48  }
49 
50  template < class TargetClass >
51  Connector0< TargetClass >::Connector0(const Connector0< TargetClass >* src) :
52  IConnector0(src) {
53  GUM_CONS_CPY(Connector0);
54  }
55 
56  template < class TargetClass >
57  Connector0< TargetClass >::~Connector0() {
58  GUM_DESTRUCTOR(Connector0);
59  }
60 
61  template < class TargetClass >
62  IConnector0* Connector0< TargetClass >::clone() {
63  return new Connector0< TargetClass >(*this);
64  }
65 
66  template < class TargetClass >
67  IConnector0* Connector0< TargetClass >::duplicate(Listener* target) {
68  return new Connector0< TargetClass >((TargetClass*)target, __action);
69  }
70 
71  template < class TargetClass >
72  void Connector0< TargetClass >::notify(const void* src) {
73  (__target->*__action)(src);
74  }
75 
76  template < class TargetClass >
77  Listener* Connector0< TargetClass >::target() const {
78  return __target;
79  }
80 
81  } // namespace __sig__
82 
83 } // namespace gum
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Class of gum::Signaler0.