]> Creatis software - bbtk.git/blob - kernel/src/bbtkConnection.cxx
Fixed Window deletion mechanism
[bbtk.git] / kernel / src / bbtkConnection.cxx
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbtkConnection.cxx,v $
4   Language:  C++
5   Date:      $Date: 2009/05/28 08:12:05 $
6   Version:   $Revision: 1.21 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31 /**
32  *\file
33  *\brief Class bbtk::Connection
34  */
35
36 #include "bbtkConnection.h"
37 #include "bbtkFactory.h"
38 #include "bbtkBlackBox.h"
39 #include "bbtkMessageManager.h"
40 #include "bbtkBlackBoxOutputConnector.h"
41
42 #define bbtkCMessage(key,level,mess) \
43   bbtkMessage(key,level,"["<<GetFullName()<<"] "<<mess)
44 #define bbtkCDebugMessage(key,level,mess)       \
45   bbtkDebugMessage(key,level,"["<<GetFullName()<<"] "<<mess)
46
47 namespace bbtk
48 {
49   const std::string IOSTATUS_STRING[3] = 
50     {"Up-to-date","Modified","Out-of-date"}; 
51   
52   const std::string& GetIOStatusString(IOStatus s)
53   { return IOSTATUS_STRING[s]; }
54
55   //==================================================================
56   Connection::Pointer Connection::New(BlackBox::Pointer from, 
57                                       const std::string& output,
58                                       BlackBox::Pointer to, 
59                                       const std::string& input ,
60                                       const Factory::Pointer f  )
61   {
62     bbtkDebugMessage("object",1,"##> Connection(\""
63                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
64                      <<to->bbGetName()<<"\",\""<<input<<"\")"
65                      <<std::endl);
66     Connection::Pointer p = 
67       MakePointer(new Connection(from,output,to,input,f));
68     bbtkDebugMessage("object",1,"<## Connection(\""
69                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
70                      <<to->bbGetName()<<"\",\""<<input<<"\")"
71                      <<std::endl);
72     return p;
73   }
74   //==================================================================
75
76   //==================================================================
77   /// Ctor with the black box from and to and their input and output.
78 /// Check the input and output compatibility
79 Connection::Connection(BlackBox::Pointer from, const std::string& output,
80                        BlackBox::Pointer to, const std::string& input ,
81                        const Factory::Pointer f  )
82     : mAdaptor(),
83       mFactory(f),
84       mFromAny(false),
85       mToAny(false)
86   {
87     bbtkDebugMessage("object",2,"==> Connection(\""
88                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
89                      <<to->bbGetName()<<"\",\""<<input<<"\")"
90                      <<std::endl);    
91
92     bbtkDebugMessage("connection",1,"==> Connection(\""
93                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
94                      <<to->bbGetName()<<"\",\""<<input<<"\")"
95                      <<std::endl);    
96
97     
98
99     if (! from->bbHasOutput(output) )
100       {
101         bbtkError("The box \""<<from->bbGetTypeName()<<
102                   "\" has no output \""<<output<<"\"");
103       }
104     if (! to->bbHasInput(input) )
105       {
106         bbtkError("The box \""<<to->bbGetTypeName()<<
107                   "\" has no input \""<<input<<"\"");
108       } 
109
110     if (to->bbGetInputConnectorMap().find(input)->second->IsConnected())
111       {
112         bbtkError("The input \""<<input<<"\" of the box \""<<to->bbGetName()
113                   <<"\" is already connected");
114       }
115     
116     //  std::string t1 ( from->bbGetOutputType(output).name() );
117     //   std::string t2 ( to->bbGetInputType(input).name() );
118     // if  //( t1 != t2 ) 
119     if ( from->bbGetOutputType(output) !=
120          to->bbGetInputType(input) )
121       {
122         if ( from->bbGetOutputType(output) == typeid(Data) )
123           {
124             bbtkWarning("Connection: '"<<from->bbGetName()<<"."<<output
125                         <<"' is of type <"
126                         <<HumanTypeName<Data>()
127                         <<"> : type compatibility with '"
128                         <<to->bbGetName()<<"."<<input
129                         <<"' will be resolved at run time"
130                         );
131             mFromAny = true;
132           }
133         else if (  to->bbGetInputType(input) == typeid(Data) )
134           {   
135             bbtkDebugMessage("kernel",8," -> '"<<input<<"' type is "
136                              <<TypeName<Data>()<<" : can receive any data"
137                              <<std::endl);
138             mToAny = true;
139           }
140         else 
141           {
142             //   std::cout << "Adaptive connection "<<std::endl;
143             std::string name;
144             name = from->bbGetName() + "." + output + "-" 
145               + to->bbGetName() + "." + input; 
146             mAdaptor = mFactory.lock()
147               ->NewAdaptor(from->bbGetOutputType(output),
148                            to->bbGetInputType(input),
149                            name);
150             if (!mAdaptor)  
151               {  
152                 bbtkError("did not find any <"
153                           <<TypeName(from->bbGetOutputType(output))
154                           <<"> to <"
155                           <<TypeName(to->bbGetInputType(input))
156                           <<"> adaptor");
157               } 
158           }
159       }
160
161
162     mFrom = from;
163     mOriginalFrom = from;
164     mTo = to;
165     mOriginalTo = to;
166     mInput = mOriginalInput = input;
167     mOutput = mOriginalOutput = output;
168
169      // Lock this pointer !!!
170     //Pointer p = MakePointer(this,true);
171     from->bbConnectOutput(output,this);
172     to->bbConnectInput(input,this);
173  
174     from->bbGetOutputConnector(output).AddChangeObserver(boost::bind(&bbtk::Connection::OnOutputChange,this, _1, _2, _3));
175
176     
177     bbtkDebugMessage("connection",1,"<== Connection(\""
178                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
179                      <<to->bbGetName()<<"\",\""<<input<<"\")"
180                      <<std::endl);    
181
182     bbtkDebugMessage("object",2,"<== Connection(\""
183                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
184                      <<to->bbGetName()<<"\",\""<<input<<"\")"
185                      <<std::endl);    
186   }
187  //==================================================================
188  
189   //==================================================================
190   Connection::Pointer Connection::New(BlackBox::Pointer from, 
191                                       const std::string& output,
192                                       BlackBox::Pointer to, 
193                                       const std::string& input )
194   {
195     bbtkDebugMessage("object",1,"##> Connection(\""
196                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
197                      <<to->bbGetName()<<"\",\""<<input<<"\")"
198                      <<std::endl);
199     Connection::Pointer p = 
200       MakePointer(new Connection(from,output,to,input));
201     bbtkDebugMessage("object",1,"<## Connection(\""
202                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
203                      <<to->bbGetName()<<"\",\""<<input<<"\")"
204                      <<std::endl);
205     return p;
206   }
207   //==================================================================
208
209   //==================================================================
210   /// Ctor with the black box from and to and their input and output.
211 /// Check the input and output compatibility
212 Connection::Connection(BlackBox::Pointer from, const std::string& output,
213                        BlackBox::Pointer to, const std::string& input )
214   : mAdaptor(),
215       mFactory(),
216       mFromAny(false),
217       mToAny(false)
218   {
219     bbtkDebugMessage("object",2,"==> Connection(\""
220                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
221                      <<to->bbGetName()<<"\",\""<<input<<"\")"
222                      <<std::endl);    
223
224     bbtkDebugMessage("connection",1,"==> Connection(\""
225                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
226                      <<to->bbGetName()<<"\",\""<<input<<"\")"
227                      <<std::endl);    
228
229     
230
231     if (! from->bbHasOutput(output) )
232       {
233         bbtkError("The box \""<<from->bbGetTypeName()<<
234                   "\" has no output \""<<output<<"\"");
235       }
236     if (! to->bbHasInput(input) )
237       {
238         bbtkError("The box \""<<to->bbGetTypeName()<<
239                   "\" has no input \""<<input<<"\"");
240       } 
241
242     if (to->bbGetInputConnectorMap().find(input)->second->IsConnected())
243       {
244         bbtkError("The input \""<<input<<"\" of the box \""<<to->bbGetName()
245                   <<"\" is already connected");
246       }
247     
248     //  std::string t1 ( from->bbGetOutputType(output).name() );
249     //   std::string t2 ( to->bbGetInputType(input).name() );
250     // if  //( t1 != t2 ) 
251     if ( from->bbGetOutputType(output) !=
252          to->bbGetInputType(input) )
253       {
254         if ( from->bbGetOutputType(output) == typeid(Data) )
255           {
256             bbtkWarning("Connection '"
257                         <<GetFullName()
258                         <<"' : '"<<from->bbGetName()<<"."<<output
259                         <<"' is of type <"
260                         <<HumanTypeName<Data>()
261                         <<"> : type compatibility with '"
262                         <<to->bbGetName()<<"."<<input
263                         <<"' will be resolved at run time"
264                         );
265             mFromAny = true;
266           }
267         else if (  to->bbGetInputType(input) == typeid(Data) )
268           {   
269             bbtkDebugMessage("kernel",8," -> '"<<input<<"' type is "
270                              <<TypeName<Data>()<<" : can receive any data"
271                              <<std::endl);
272             mToAny = true;
273           }
274         else 
275           {
276             bbtkError("Connection created between different types without Factory provided");
277           }
278       }
279
280
281     mFrom = from;
282     mOriginalFrom = from;
283     mTo = to;
284     mOriginalTo = to;
285     mInput = mOriginalInput = input;
286     mOutput = mOriginalOutput = output;
287
288      // Lock this pointer !!!
289     //Pointer p = MakePointer(this,true);
290     from->bbConnectOutput(output,this);
291     to->bbConnectInput(input,this);
292
293     from->bbGetOutputConnector(output).AddChangeObserver(boost::bind(&bbtk::Connection::OnOutputChange,this, _1, _2, _3));
294     
295     bbtkDebugMessage("connection",1,"<== Connection(\""
296                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
297                      <<to->bbGetName()<<"\",\""<<input<<"\")"
298                      <<std::endl);    
299
300     bbtkDebugMessage("object",2,"==> Connection(\""
301                      <<from->bbGetName()<<"\",\""<<output<<"\",\""
302                      <<to->bbGetName()<<"\",\""<<input<<"\")"
303                      <<std::endl);    
304   }
305  //==================================================================
306  
307   //==================================================================
308   /// Dtor 
309   Connection::~Connection()
310   {
311     bbtkCDebugMessage("object",4,
312                      "==> ~Connection()"
313                      <<std::endl);
314
315     if (mAdaptor) mAdaptor.reset();
316     if (mFrom!=0) 
317       {
318         mFrom->bbDisconnectOutput(mOutput,this);
319         //                                GetThisPointer<Connection>());
320         mFrom.reset();
321       }
322     else 
323       {
324         bbtkInternalError("~Connection() : invalid initial box pointer");
325       }
326     if (mTo!=0) 
327       {
328         mTo->bbDisconnectInput(mInput,this);//   GetThisPointer<Connection>());
329         mTo.reset();
330       }
331     else 
332       {
333         bbtkInternalError("~Connection() : invalid final box pointer");
334       }
335
336
337     bbtkCDebugMessage("object",4,
338                       "<== ~Connection()"
339                       <<std::endl);
340   }
341   //==================================================================
342   
343   //==================================================================
344   /// Recursive execution
345   void Connection::RecursiveExecute()
346   {
347     bbtkCDebugMessage("process",4,
348                       "===> Connection::RecursiveExecute()"
349                       <<std::endl);
350
351     /*
352     // If box from already executing : nothing to do
353     if (mFrom->bbGetExecuting()) 
354       {
355         bbtkDebugMessage("process",3,
356                          " -> "<<mFrom->bbGetName()
357                          <<" already executing : abort"<<std::endl);
358         return; 
359
360       }
361     */
362
363     mFrom->bbRecursiveExecute(GetThisPointer<Connection>());
364
365     TransferData();
366
367     // Transfer status
368     IOStatus s = MODIFIED;
369     if ( mFrom->bbGetOutputConnector(mOutput).GetStatus() == OUTOFDATE) 
370       {
371         s = OUTOFDATE;
372       }
373     mTo->bbGetInputConnector(mInput).SetStatus(s);
374     
375     bbtkCDebugMessage("process",4,
376                      " --> '"<<mTo->bbGetName()<<"."<<mInput
377                      <<" ["<<&mTo->bbGetInputConnector(mInput)<<"] "
378                      <<"' new status '"
379                      <<GetIOStatusString(s)
380                      <<"'"
381                      << std::endl);
382
383     bbtkCDebugMessage("process",4,
384                      "<=== Connection::RecursiveExecute()"
385                       <<std::endl);
386     return; 
387   }
388   //==================================================================
389
390
391
392   //==================================================================
393   /// Transfers the data from the source output to the target input
394   /// doing necessary conversions (adaptation or pointer cast)
395   void Connection::TransferData()
396   {
397     bbtkCDebugMessage("data",3,
398                       "Connection::TransferData()"
399                       <<std::endl);
400     
401     
402     // If an adaptor was created we need to adapt the data
403     if (mAdaptor) 
404       {
405         mAdaptor->bbSetInput("In",mFrom->bbGetOutput(mOutput),false);
406         mAdaptor->bbExecute();
407         // LG : Connection Update does not set mTo as modified
408         mTo->bbSetInput(mInput, mAdaptor->bbGetOutput("Out"),false);
409         
410       }
411     // If no adaptor but source type is an any and target is not an any
412     else if ( mFromAny && (! mToAny) )
413       {
414         bbtkCDebugMessage("data",3,
415                          " * Source type is an "
416                          <<HumanTypeName<Data>()
417                          <<" which contains a <"
418                          <<HumanTypeName(mFrom->bbGetOutput(mOutput).type())
419                          <<">"<<std::endl);
420         bbtkCDebugMessage("data",3,
421                          " * Target type is <"
422                          <<HumanTypeName(mTo->bbGetInputType(mInput))
423                          <<">"<<std::endl);
424         
425         // 0) If from any contents void : nothing to do 
426         if (mFrom->bbGetOutput(mOutput).type() == typeid(void)) 
427           {
428             bbtkCDebugMessage("data",3,
429                              " -> Source is void : nothing to transfer!"<<std::endl);
430           }
431         // 1) Test strict type matching between any content and target
432         else if (mFrom->bbGetOutput(mOutput)
433             .contains( mTo->bbGetInputType(mInput) ) )
434           {
435             bbtkCDebugMessage("data",3,
436                              " -> Equal types : transfer ok"<<std::endl);
437             mTo->bbSetInput( mInput, 
438                              mFrom->bbGetOutput(mOutput),
439                              false);
440           }
441         else 
442           {
443             // 2) Look for an adaptor
444             bbtk::BlackBox::Pointer adaptor;
445             try 
446               {
447                 adaptor = mFactory.lock()
448                   ->NewAdaptor(mFrom->bbGetOutput(mOutput).type(),
449                                mTo->bbGetInputType(mInput),
450                                "");
451               }
452             catch (...)
453               {
454               }
455             if (adaptor)  
456               {
457                 bbtkCDebugMessage("data",3," -> Adaptor found : using it"
458                                  <<std::endl);
459                   adaptor->bbSetInput("In",mFrom->bbGetOutput(mOutput),false);
460                 adaptor->bbExecute();
461                 // LG : Connection Update does not set mTo as modified
462                 mTo->bbSetInput(mInput, adaptor->bbGetOutput("Out"),false);
463                 //      adaptor->bbDelete();
464               }
465             // 3) If no adaptor found but the any content is a pointer
466             //    and target type is also a pointer : we try run-time cast
467             else if ( (mFrom->bbGetOutput(mOutput).contains_pointer()) &&
468                       (mTo->bbGetDescriptor()->GetInputDescriptor(mInput)
469                        ->IsPointerType()) )
470               {
471                 bbtkCDebugMessage("data",3,
472                                  " -> No adaptor found but source and target types are both pointers : trying up or down cast"<<std::endl);
473                 
474                 void* nptr = 
475                   mFrom->bbGetOutput(mOutput)
476                   .get_pointer_to(mTo->bbGetInput(mInput).pointed_type());
477                 if (!nptr)  
478                   {
479                     bbtkError("Connection '"
480                               <<GetFullName()
481                               <<"' : <"
482                               <<HumanTypeName(mFrom->bbGetOutput(mOutput).type())
483                               <<"> to <"
484                               <<HumanTypeName(mTo->bbGetInputType(mInput))
485                               <<"> : no adaptor available and run-time up and down cast failed");
486                   }
487                 mTo->bbBruteForceSetInputPointer(mInput, nptr, false);
488               }
489             // 4) Nothing worked : error
490             else 
491               {
492                 bbtkError("Connection '"<<GetFullName()<<"' "
493                           <<"no adaptor found to convert <"
494                           <<HumanTypeName(mFrom->bbGetOutput(mOutput).type())
495                           <<"> to <"
496                           <<HumanTypeName(mTo->bbGetInputType(mInput))<<">");
497               }
498           }
499       }
500     // EO : mFromAny && ! mToAny
501     // Default case : types are the same; we use simple get-set
502     else 
503       {
504         // LG : Connection Update does not set mTo as modified
505         mTo->bbSetInput(mInput, mFrom->bbGetOutput(mOutput),false);
506       }
507
508   }
509   //==================================================================
510
511   //==================================================================
512   /// From.Output change propagation
513   void Connection::OnOutputChange(bbtk::BlackBox::Pointer, const std::string&, 
514                                   IOStatus status)
515   {
516     bbtkCDebugMessage("change",2,
517                      "==> Connection::OnOutputChange("
518                      <<GetIOStatusString(status)<<")"
519                      <<std::endl);
520     if (mAdaptor) 
521       {
522             BlackBoxInputConnector* ac = mAdaptor->bbGetInputConnectorMap().find("In")->second;
523             mAdaptor->bbSetStatusAndPropagate(ac,status);
524       }
525     
526     mTo->bbSetStatusAndPropagate( mTo->bbGetInputConnectorMap().find(mInput)->second, status);
527     
528  
529   }
530   //==================================================================
531
532   
533   //==================================================================
534   std::string Connection::GetFullName() const {
535     if (mFrom && mTo) 
536       {
537         std::string res = mFrom->bbGetName()+"."+mOutput+"--"
538           +mTo->bbGetName()+"."+mInput;
539         if ((!mOriginalFrom.expired()) && (!mOriginalTo.expired()) &&
540             ((mFrom!=mOriginalFrom.lock())||(mTo!=mOriginalTo.lock())))
541           {
542             res += "("+mOriginalFrom.lock()->bbGetName()
543               +"."+mOriginalOutput+"--"
544               + mOriginalTo.lock()->bbGetName()+"."+mOriginalInput+")";
545           }
546         return res;
547       }
548     return "***Invalid Connection***";
549   }
550   //==================================================================
551
552   //==================================================================
553   void Connection::Check() const
554   {
555     bbtkMessage("debug",1,"** Checking Connection "<<(void*)this<<" ["
556                 <<GetFullName()<<"]"
557                 <<std::endl);
558     if (mFrom==0) 
559       {
560         bbtkMessage("debug",2," - From = 0"<<std::endl);
561       }
562     else
563       {
564         bbtkMessage("debug",2," - From : "<<mFrom->bbGetName()<<std::endl);
565         if (!mFrom->bbHasOutput(mOutput))
566           {
567             bbtkError("** Checking Connection "<<(void*)this
568                        <<" ["<<GetFullName()<<"] : "
569                       << mFrom->bbGetName()<<" does not have output '"
570                       <<mOutput<<"'");
571           }     
572         bbtkMessage("debug",2," - From : Output '"<<mOutput<<"' exists"<<std::endl);
573         BlackBox::OutputConnectorMapType::const_iterator i 
574           = mFrom->bbGetOutputConnectorMap().find(mOutput);
575         if (i== mFrom->bbGetOutputConnectorMap().end())
576           {
577              bbtkError("** Checking Connection "<<(void*)this
578                        <<" ["<<GetFullName()<<"] : "
579                        <<mFrom->bbGetName()<<" output '"
580                        <<mOutput<<"' is not in OutputConnectorMap");
581           }
582         bbtkMessage("debug",2," - From : Output '"<<mOutput
583                     <<"' is in OutputConnectorMap"<<std::endl);
584
585         std::vector< Connection* >::const_iterator j;
586         /*
587         for (j  = i->second->GetConnectionVector().begin();
588              j != i->second->GetConnectionVector().end();
589              ++j)
590           {
591             if ((*j)==this) break;
592           }
593         */
594         j = find(i->second->GetConnectionVector().begin(),
595                  i->second->GetConnectionVector().end(),
596                  this);
597        
598         if (j==i->second->GetConnectionVector().end())
599           {
600             bbtkError("** Checking Connection "<<(void*)this
601                       <<" ["<<GetFullName()<<"] : "
602                       <<" OutputConnector '"
603                       <<mOutput<<"' of "<<mFrom->bbGetName()
604                       <<" does not point to this connection");
605             
606           }
607         bbtkMessage("debug",2," - From : This connection is in OutputConnector connection vector"<<std::endl);
608         bbtkMessage("debug",2," * Box from : Check successfull"<<std::endl);
609
610       }
611
612     if (mTo==0) 
613       {
614         bbtkMessage("debug",2," - To   = 0"<<std::endl);
615       }
616     else
617       {
618         bbtkMessage("debug",2," - To   : "<<mTo->bbGetName()<<std::endl);
619         //      std::cout << mTo << std::endl;
620         //      std::cout << mTo->bbGetDescriptor() << std::endl;
621         //      std::cout << mTo->bbGetDescriptor()->GetTypeName() << std::endl;
622         //      mTo->bbGetName();
623         bbtkMessage("debug",2," - To   : "<<mTo->bbGetName()<<std::endl);
624         if (!mTo->bbHasInput(mInput))
625           {
626             bbtkError("** Checking Connection "<<(void*)this
627                       <<" ["<<GetFullName()<<"] : "
628                       <<mTo->bbGetName()<<" does not have input '"
629                       <<mInput<<"'");
630           }     
631         bbtkMessage("debug",2," - To   : Input '"<<mInput<<"' exists"<<std::endl);
632         BlackBox::InputConnectorMapType::const_iterator i 
633           = mTo->bbGetInputConnectorMap().find(mInput);
634         if (i== mTo->bbGetInputConnectorMap().end())
635           {
636              bbtkError("** Checking Connection "<<(void*)this
637                        <<" ["<<GetFullName()<<"] : "
638                        <<mTo->bbGetName()<<" input '"
639                        <<mInput<<"' is not in InputConnectorMap");
640           }
641         bbtkMessage("debug",2," - To   : Input '"<<mInput
642                     <<"' is in InputConnectorMap"<<std::endl);
643
644         if (i->second->GetConnection()==0)
645           {
646             bbtkError("** Checking Connection "<<(void*)this
647                       <<" ["<<GetFullName()<<"] : "
648                       <<" InputConnector '"
649                       <<mInput<<"' of "<<mTo->bbGetName()
650                       <<" does not point to this connection");
651     
652           }
653         bbtkMessage("debug",2," - To   : This connection is in InputConnector connection vector"<<std::endl);
654         bbtkMessage("debug",2," * Box to   : Check successfull"<<std::endl);
655
656       }
657   }
658   //==================================================================
659  //==========================================================================
660   std::string Connection::GetObjectName() const
661   {
662     std::string s("Connection '");
663     s += GetFullName();
664     s += "'";
665     return s;
666   }
667   //==========================================================================
668   
669   //==========================================================================
670   std::string  Connection::GetObjectInfo() const 
671   {
672     std::stringstream i;
673     return i.str();
674   }
675   //==========================================================================
676
677  //==========================================================================
678 size_t  Connection::GetObjectSize() const 
679 {
680   size_t s = Superclass::GetObjectSize();
681   s += Connection::GetObjectInternalSize();
682   return s;
683   }
684   //==========================================================================
685   //==========================================================================
686 size_t  Connection::GetObjectInternalSize() const 
687 {
688   size_t s = sizeof(Connection);
689   return s;
690   }
691   //==========================================================================
692   //==========================================================================
693   size_t  Connection::GetObjectRecursiveSize() const 
694   {
695     size_t s = Superclass::GetObjectRecursiveSize();
696     s += Connection::GetObjectInternalSize();
697     return s;
698   }
699   //==========================================================================
700
701 }// namespace bbtk
702
703
704
705
706