From cec61f96cb3756b479e155f4b50e9e00c9c2ae3d Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Tue, 24 Jun 2008 11:09:30 +0000 Subject: [PATCH] Inspector support for const set<>& --- hurricane/src/hurricane/Technology.cpp | 1 - hurricane/src/hurricane/hurricane/Commons.h | 31 ++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/hurricane/src/hurricane/Technology.cpp b/hurricane/src/hurricane/Technology.cpp index 8ba20e67..77838ffd 100644 --- a/hurricane/src/hurricane/Technology.cpp +++ b/hurricane/src/hurricane/Technology.cpp @@ -209,7 +209,6 @@ Record* Technology::_getRecord() const if (record) { record->add(getSlot("DataBase", _dataBase)); record->add(getSlot("Name", &_name)); - cerr << "Adding Layers Slot - " << hex << (void*)&_layerList << endl; record->add(getSlot("Layers", &_layerList)); } return record; diff --git a/hurricane/src/hurricane/hurricane/Commons.h b/hurricane/src/hurricane/hurricane/Commons.h index 5b2cd0cb..e0ff1178 100644 --- a/hurricane/src/hurricane/hurricane/Commons.h +++ b/hurricane/src/hurricane/hurricane/Commons.h @@ -129,7 +129,7 @@ template inline Hurricane::Slot* getSlot ( const std::string& nam // Default match. template inline std::string getString ( Data data ) -{ return ""; } +{ return ""; } // "const *" flavors. @@ -440,6 +440,8 @@ inline Hurricane::Record* getRecord ( const std::set* s ) return record; } +// ------------------------------------------------------------------- +// Inspector Support for : "std::set*". template inline std::string getString ( std::set* s ) @@ -465,6 +467,33 @@ inline Hurricane::Record* getRecord ( std::set* s ) return record; } +// ------------------------------------------------------------------- +// Inspector Support for : "[const] std::set&". + + +template +inline std::string getString ( const std::set& s ) +{ + std::string name = "const std::set:"; + return name + getString(s.size()); +} + + +template +inline Hurricane::Record* getRecord ( const std::set& s ) +{ + Hurricane::Record* record = NULL; + if ( !s.empty() ) { + record = new Hurricane::Record ( "const std::set" ); + unsigned n = 1; + typename std::set::const_iterator iterator = s.begin(); + while ( iterator != s.end() ) { + record->add ( getSlot(getString(n++), *iterator) ); + ++iterator; + } + } + return record; +} // ------------------------------------------------------------------- // Inspector Support for : "const std::multiset*".