Program: bbtk
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
- Date: $Date: 2009/10/05 22:44:48 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2010/09/12 14:59:29 $
+ Version: $Revision: 1.51 $
=========================================================================*/
/* ---------------------------------------------------------------------
//===================================================================
+// ups3 EED borrame
+ std::string Factory::GetPackageNameOfaBlackBox(std::string boxType)
+ {
+ std::string result="<void bbtk package name>";
+ PackageMapType::const_iterator i;
+ for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
+ {
+ if ( i->second->ifBoxExist( boxType ) == true)
+ {
+ result = i->first;
+ }
+ }
+ return result;
+ }
+
+
//===================================================================
/// Creates an instance of a black box of type <type> with name <name>
BlackBox::Pointer Factory::NewBlackBox(const std::string& type,
void Factory::ShowGraphTypes(const std::string& name) const
{
-
bool found = false;
PackageMapType::const_iterator i;
for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
std::string title;
typedef std::map<std::string,
- std::vector<BlackBoxDescriptor::Pointer> > IndexType;
+ std::vector<BlackBoxDescriptor::Pointer> > IndexType;
IndexType index;
// Builds the index map
PackageMapType::const_iterator i;
for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
- {
- Package::Pointer pack = i->second;
- if (pack->GetName()=="user") continue;
- Package::DescriptorMapType::const_iterator j;
- for (j = pack->GetDescriptorMap().begin();
- j!= pack->GetDescriptorMap().end();
- ++j)
- {
+ {
+ Package::Pointer pack = i->second;
+ if (pack->GetName()=="user") continue;
+ Package::DescriptorMapType::const_iterator j;
+ for (j = pack->GetDescriptorMap().begin();
+ j!= pack->GetDescriptorMap().end();
+ ++j)
+ {
// Skip adaptors
- if ( type==Adaptors )
- {
- if (j->second->GetKind() == BlackBoxDescriptor::STANDARD )
- continue;
- }
- else
- if (j->second->GetKind() != BlackBoxDescriptor::STANDARD )
- continue;
+ if ( type==Adaptors )
+ {
+ if (j->second->GetKind() == BlackBoxDescriptor::STANDARD )
+ continue;
+ }
+ else
+ if (j->second->GetKind() != BlackBoxDescriptor::STANDARD )
+ continue;
- std::vector<std::string> keys;
- if (type==Packages)
- {
- std::string k("");
- k += pack->GetName();
- keys.push_back(k);
- title = "Boxes by package";
- }
- else if ((type==Initials) || (type==Adaptors))
- {
- std::string init(" ");
- init[0] = std::toupper(j->second->GetTypeName()[0]);
- keys.push_back(init);
- title = "Alphabetical list";
- }
- else if (type==Categories)
- {
- // Split the category string
- std::string delimiters = ";,";
- Utilities::SplitString(j->second->GetCategory(),
- delimiters,keys);
- if (keys.size()==0)
- keys.push_back(" NONE");
- title = "Boxes by category";
- }
-
-
- std::vector<std::string>::const_iterator k;
- for (k=keys.begin(); k!=keys.end(); ++k )
- {
- IndexType::iterator p;
- p = index.find(*k);
- if (p != index.end())
- {
- p->second.push_back(j->second);
- }
- else
- {
- std::vector<BlackBoxDescriptor::Pointer> v;
- v.push_back(j->second);
- index[*k] = v;
- }
- }
-
- }
- }
+ std::vector<std::string> keys;
+ if (type==Packages)
+ {
+ std::string k("");
+ k += pack->GetName();
+ keys.push_back(k);
+ title = "Boxes by package";
+ }
+ else if ((type==Initials) || (type==Adaptors))
+ {
+ std::string init(" ");
+ init[0] = std::toupper(j->second->GetTypeName()[0]);
+ keys.push_back(init);
+ title = "Alphabetical list";
+ }
+ else if (type==Categories)
+ {
+ // Split the category string
+ std::string delimiters = ";,";
+ Utilities::SplitString(j->second->GetCategory(),
+ delimiters,keys);
+ if (keys.size()==0)
+ keys.push_back(" NONE");
+ title = "Boxes by category";
+ }
+
+ std::vector<std::string>::const_iterator k;
+ for (k=keys.begin(); k!=keys.end(); ++k )
+ {
+ IndexType::iterator p;
+ p = index.find(*k);
+ if (p != index.end())
+ {
+ p->second.push_back(j->second);
+ }
+ else
+ {
+ std::vector<BlackBoxDescriptor::Pointer> v;
+ v.push_back(j->second);
+ index[*k] = v;
+ }
+ }
+ }
+ }
// Creates the file
//---------------------
// Open output file
IndexType::iterator ii;
for (ii=index.begin();ii!=index.end();++ii)
{
- s << "<a href=\"#"<<ii->first<<"\">"<<ii->first<<"</a> ";
+ s << "<a href=\"#"<<ii->first<<"\">"<<ii->first<<"</a> ";
}
for (ii=index.begin();ii!=index.end();++ii)
s << " - \n";
s << "<a name=\"doxygen\"></a>\n";
-//EED 26Mars2009
+
+//EED 26Mars2009
+ /*JCP 19 Nov 2009
std::string bin_path = bbtk::ConfigurationFile::GetInstance().Get_bin_path();
s << "<a href=" << bin_path <<"/../share/bbtk/doc/doxygen/" << ii->first << "/main.html>(Doxygen documentation of the source)</a>\n";
+ JCP 19 Nov 2009*/
+ std::string bin_path = bbtk::ConfigurationFile::GetInstance().Get_bin_path();
+ s << "<a href=" << bin_path <<"/../share/bbtk/doc/doxygen/" << ii->first << "/main.html>(Doxygen documentation of the source)</a>\n";
}
else
{