Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
-Date: $Date: 2008/03/11 12:27:21 $
-Version: $Revision: 1.30 $
+Date: $Date: 2008/04/08 06:59:30 $
+Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
//===================================================================
void Factory::Reset()
{
- /*
-printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
-printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
-printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
-printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
-printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
-printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
- */
bbtkDebugMessageInc("Kernel",7,"Factory::Reset()"<<std::endl);
CloseAllPackages();
bbtkDebugDecTab("Kernel",7);
//===================================================================
/// Creates an instance of a black box of type <type> with name <name>
- BlackBox* Factory::NewAdaptor(TypeInfo typein,
- TypeInfo typeout,
- const std::string& name) const
+ BlackBox* Factory::NewAdaptor(const DataInfo& typein,
+ const DataInfo& typeout,
+ const std::string& name) const
{
- bbtkDebugMessageInc("Kernel",8,"Factory::NewAdaptor(<"
- <<TypeName(typein)<<">,<"
- <<TypeName(typeout)<<">,\""
+ bbtkDebugMessageInc("Kernel",8,"Factory::NewAdaptor("
+ <<typein<<","
+ <<typeout<<",\""
<<name<<"\")"<<bbtkendl);
}
if (!b)
{
- bbtkError("no <"
- <<TypeName(typein)<<"> to <"
- <<TypeName(typeout)
- <<"> adaptor available");
+ bbtkError("no "<<typein<<" to "<<typeout
+ <<" adaptor available");
+ }
+
+ bbtkDebugDecTab("Kernel",7);
+ return b;
+ }
+ //===================================================================
+
+
+ //===================================================================
+ /// Creates an instance of a black box of type <type> with name <name>
+ BlackBox* Factory::NewWidgetAdaptor(const DataInfo& typein,
+ const DataInfo& typeout,
+ const std::string& name) const
+ {
+ bbtkDebugMessageInc("Kernel",8,"Factory::NewWidgetAdaptor(<"
+ <<typein<<">,<"
+ <<typeout<<">,\""
+ <<name<<"\")"<<bbtkendl);
+
+
+ BlackBox* b = 0;
+ PackageMapType::const_iterator i;
+ for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
+ {
+ b = i->second.mPackage->NewWidgetAdaptor(typein,
+ typeout,
+ name);
+ if (b) break;
+ }
+ if (!b)
+ {
+ bbtkError("no "<<typein<<" to "<<typeout
+ <<"> widget adaptor available");
+ }
+
+ bbtkDebugDecTab("Kernel",7);
+ return b;
+ }
+ //===================================================================
+
+ //===================================================================
+ /// Creates an instance of a black box of type <type> with name <name>
+ bool Factory::FindAdaptor(const DataInfo& typein,
+ const DataInfo& typeout,
+ std::string& adaptor) const
+ {
+ bbtkDebugMessageInc("Kernel",8,"Factory::FindWidgetAdaptor(<"
+ <<typein<<">,<"
+ <<typeout<<">)"<<bbtkendl);
+
+ bool b = false;
+ PackageMapType::const_iterator i;
+ for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
+ {
+ b = i->second.mPackage->FindAdaptor(typein,
+ typeout,
+ adaptor);
+ if (b) break;
+ }
+ /*
+ if (!b)
+ {
+ bbtkError("no "<<typein<<" to "<<typeout
+ <<"> widget adaptor available");
}
+ */
+
+ bbtkDebugDecTab("Kernel",7);
+ return b;
+ }
+ //===================================================================
+
+ //===================================================================
+ /// Creates an instance of a black box of type <type> with name <name>
+ bool Factory::FindWidgetAdaptor(const DataInfo& typein,
+ const DataInfo& typeout,
+ std::string& adaptor) const
+ {
+ bbtkDebugMessageInc("Kernel",8,"Factory::FindWidgetAdaptor(<"
+ <<typein<<">,<"
+ <<typeout<<">)"<<bbtkendl);
+ bool b = false;
+ PackageMapType::const_iterator i;
+ for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
+ {
+ b = i->second.mPackage->FindWidgetAdaptor(typein,
+ typeout,
+ adaptor);
+ if (b) break;
+ }
+ /*
+ if (!b)
+ {
+ bbtkError("no "<<typein<<" to "<<typeout
+ <<"> widget adaptor available");
+ }
+ */
+
bbtkDebugDecTab("Kernel",7);
return b;
}