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