arcsconnection.cpp
1 /*
2  name: lib/arcsconnection.cpp
3 
4  This file is part of ARCS - Augmented Reality Component System
5  (version 2-current), written by Jean-Yves Didier
6  for IBISC Laboratory (http://www.ibisc.univ-evry.fr)
7 
8  Copyright (C) 2013 Université d'Evry-Val d'Essonne
9 
10  This program is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Please send bugreports with examples or suggestions to
25  jean-yves.didier__at__ibisc.univ-evry.fr
26 */
27 
28 
29 #include <arcs/arcsconnection.h>
30 
31 #include <iostream>
32 
33 ARCSConnection ARCSConnection::null = ARCSConnection();
34 
36 {
37  queued = false;
38  source = 0;
39  destination = 0;
40  signalName = QString::null ;
41  slotName = QString::null;
42 }
43 
45 {
46  queued = a.queued;
47  source = a.source;
48  destination = a.destination;
49  signalName = a.signalName;
50  slotName = a.slotName;
51  coordinates = a.coordinates;
52 }
53 
54 
56  ARCSAbstractComponent* d, QString slt,
57  bool q)
58 {
59  source = s;
60  destination = d;
61  signalName = sgn;
62  slotName = slt;
63  queued = q;
64 }
65 
66 
68 {
69  if ( source != NULL && destination != NULL)
70  return source->connect(signalName, destination, slotName, queued);
71  return false;
72 }
73 
74 
76 {
77  if ( source != NULL && destination != NULL)
78  return source->disconnect(signalName, destination, slotName);
79  return false;
80 }
bool disconnect(QString sig, ARCSAbstractComponent *dst, QString slt)
This method disconnects two components by the indicated signals and slots.
bool disconnect()
Disconnects the connection.
Describes a connection.
Class handling the generic description of a component.
bool connect()
Make the connection happen.
virtual bool connect(QString sig, ARCSAbstractComponent *dst, QString slt, bool queued=false)
This method connects two components by the indicated signals and slots.