29 #include <arcs/arcsfactory.h>
78 void usage(
char* name)
80 std::cout <<
"Usage: " << name <<
" libraries..." << std::endl;
81 std::cout <<
"This tool is intended to dump library contents. " << std::endl;
82 std::cout <<
"It is designed to debug complex component libraries using component families" << std::endl;
86 void dumpLibrary(
char* name)
91 std::cout <<
"Library " << name << std::endl<<
"{" << std::endl;
95 if (familyList.count())
98 std::cout <<
"\tFamilies" << std::endl <<
"\t{" << std::endl;
99 for(i=0; i<familyList.count(); i++)
102 && !familyList[i].startsWith(QString(name)+
":"))
103 std::cout <<
"\t\t" << qPrintable(familyList[i]) <<
";" << std::endl;
105 std::cout <<
"\t}" << std::endl;
109 if (typeList.count())
112 std::cout <<
"\tTypes" << std::endl <<
"\t{" << std::endl;
113 for(i=0; i<typeList.count(); i++)
116 && !typeList[i].startsWith(QString(name)+
":"))
117 std::cout <<
"\t\t" << qPrintable(typeList[i]) <<
";" << std::endl;
119 std::cout <<
"\t}" << std::endl;
123 if (componentList.count())
125 componentList.sort();
126 std::cout <<
"\tComponents" << std::endl <<
"\t{" << std::endl;
128 for(i=0; i<componentList.count(); i++)
130 std::cout <<
"\t\t" << qPrintable(componentList[i]) << std::endl;
133 std::cout <<
"\t\t{" << std::endl;
135 QStringList slotList = aac->
getSlots();
136 if (slotList.count())
138 std::cout <<
"\t\t\tSlots {" << std::endl;
139 for (j=0; j < slotList.count(); j++)
140 std::cout <<
"\t\t\t\t" << qPrintable(slotList[j]) <<
";" << std::endl;
141 std::cout <<
"\t\t\t}" << std::endl;
145 if (signalList.count())
147 std::cout <<
"\t\t\tSignals {" << std::endl;
148 for (j=0; j < signalList.count(); j++)
149 std::cout <<
"\t\t\t\t" << qPrintable(signalList[j]) <<
";" << std::endl;
150 std::cout <<
"\t\t\t}" << std::endl;
153 std::cout <<
"\t\t}" << std::endl;
155 std::cout <<
"\t}" << std::endl;
158 std::cout <<
"}" << std::endl;
166 int main(
int argc,
char* argv[])
174 for (
int i=1; i<argc; i++)
175 dumpLibrary(argv[i]);
void destroyComponent(ARCSAbstractComponent *aac)
Destroys a component.
QString getTypeLibrary(QString s)
Returns the path of the library associated to a certain kind of type.
virtual QStringList getSlots()=0
Returns the names of the available slots.
static ARCSFactory * getInstance()
Returns the instance of the singleton ARCSFactory.
QStringList getFamilyNames()
Returns the names of the family currently stored.
Class handling the generic description of a component.
A singleton handling all needed factories in ARCS runtime.
void unLoadLibrary(QString path)
Unloads a library given the path to it.
ARCSAbstractComponent * createComponent(QString componentType)
Creates a component given its class name.
QString getFamilyLibrary(QString s)
bool loadLibrary(QString path)
Loads a library given the path to it.
QStringList getLibraryComponents(QString s)
Returns the list of components associated to a library.
QStringList getTypeNames()
Returns the names of the types currently stored.
virtual QStringList getSignals()=0
Returns the names of the availables signals.