Inspector support for const set<>&

This commit is contained in:
Christophe Alexandre 2008-06-24 11:09:30 +00:00
parent b558804b3c
commit cec61f96cb
2 changed files with 30 additions and 2 deletions

View File

@ -209,7 +209,6 @@ Record* Technology::_getRecord() const
if (record) { if (record) {
record->add(getSlot("DataBase", _dataBase)); record->add(getSlot("DataBase", _dataBase));
record->add(getSlot("Name", &_name)); record->add(getSlot("Name", &_name));
cerr << "Adding Layers Slot - " << hex << (void*)&_layerList << endl;
record->add(getSlot("Layers", &_layerList)); record->add(getSlot("Layers", &_layerList));
} }
return record; return record;

View File

@ -129,7 +129,7 @@ template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& nam
// Default match. // Default match.
template<typename Data> inline std::string getString ( Data data ) template<typename Data> inline std::string getString ( Data data )
{ return "<Data Unsupported by Inspector>"; } { return "<Data Unsupported by getString>"; }
// "const *" flavors. // "const *" flavors.
@ -440,6 +440,8 @@ inline Hurricane::Record* getRecord ( const std::set<Element,Compare>* s )
return record; return record;
} }
// -------------------------------------------------------------------
// Inspector Support for : "std::set<Element,Compare>*".
template<typename Element, typename Compare> template<typename Element, typename Compare>
inline std::string getString ( std::set<Element,Compare>* s ) inline std::string getString ( std::set<Element,Compare>* s )
@ -465,6 +467,33 @@ inline Hurricane::Record* getRecord ( std::set<Element,Compare>* s )
return record; return record;
} }
// -------------------------------------------------------------------
// Inspector Support for : "[const] std::set<Element,Compare>&".
template<typename Element, typename Compare>
inline std::string getString ( const std::set<Element,Compare>& s )
{
std::string name = "const std::set<Element>:";
return name + getString<size_t>(s.size());
}
template<typename Element, typename Compare>
inline Hurricane::Record* getRecord ( const std::set<Element,Compare>& s )
{
Hurricane::Record* record = NULL;
if ( !s.empty() ) {
record = new Hurricane::Record ( "const std::set<Element>" );
unsigned n = 1;
typename std::set<Element,Compare>::const_iterator iterator = s.begin();
while ( iterator != s.end() ) {
record->add ( getSlot<Element>(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Inspector Support for : "const std::multiset<Element,Compare>*". // Inspector Support for : "const std::multiset<Element,Compare>*".