diff --git a/hurricane/src/hurricane/Bug.cpp b/hurricane/src/hurricane/Bug.cpp new file mode 100644 index 00000000..f24f29f7 --- /dev/null +++ b/hurricane/src/hurricane/Bug.cpp @@ -0,0 +1,105 @@ + +// -*- C++ -*- +// +// This file is part of the Hurricane Software. +// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | H U R R I C A N E | +// | V L S I B a c k e n d D a t a - B a s e | +// | | +// | Author : Remy Escassut | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Module : "./Bug.cpp" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +# include + +# include "hurricane/Bug.h" + + +namespace Hurricane { + + +// ------------------------------------------------------------------- +// Class : "Hurricane::Bug". + + + Bug::Bug ( const string& reason ) + : Exception() + , _reason(reason) + , _code(0) + { } + + + Bug::Bug ( int code, const string& reason ) + : Exception() + , _reason(reason) + , _code(code) + { } + + + Bug::Bug ( const char* format, ... ) + : Exception() + , _reason() + , _code(0) + { + static char formatted [ 8192 ]; + va_list args; + + va_start ( args, format ); + vsnprintf ( formatted, 8191, format, args ); + va_end ( args ); + + _reason = formatted; + } + + + Bug::Bug ( int code, const char* format, ... ) + : Exception() + , _reason() + , _code(code) + { + static char formatted [ 8192 ]; + va_list args; + + va_start ( args, format ); + vsnprintf ( formatted, 8191, format, args ); + va_end ( args ); + + _reason = formatted; + } + + + Bug::Bug ( const Bug& error ) + : Exception() + , _reason(error._reason) + , _code(error._code) + { + } + + + string Bug::_getTypeName () const + { return _TName("Bug"); } + + + string Bug::_getString () const + { + if ( !_code ) + return "[BUG] " + _reason; + + return "[BUG:" + getString(_code) + "] " + _reason; + } + + +} // End of Hurricane namespace. diff --git a/hurricane/src/hurricane/CMakeLists.txt b/hurricane/src/hurricane/CMakeLists.txt index 634c971e..53ce6d6f 100644 --- a/hurricane/src/hurricane/CMakeLists.txt +++ b/hurricane/src/hurricane/CMakeLists.txt @@ -2,6 +2,7 @@ include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane ) set ( includes hurricane/Mask.h + hurricane/DebugSession.h hurricane/BasicLayer.h hurricane/BasicLayers.h hurricane/RegularLayer.h hurricane/RegularLayers.h hurricane/ViaLayer.h hurricane/ViaLayers.h @@ -19,6 +20,7 @@ hurricane/DeepNet.h hurricane/DRCError.h hurricane/Entities.h hurricane/Entity.h + hurricane/Bug.h hurricane/Error.h hurricane/Exception.h hurricane/Filter.h @@ -67,7 +69,6 @@ hurricane/SharedPathes.h hurricane/SharedPath.h hurricane/Slice.h hurricane/Slices.h hurricane/ExtensionSlice.h hurricane/ExtensionSlices.h - hurricane/SlotAdapter.h hurricane/Slot.h hurricane/Symbols.h hurricane/Tabulation.h @@ -85,11 +86,13 @@ Slot.cpp Commons.cpp Exception.cpp + Bug.cpp Error.cpp DRCError.cpp Warning.cpp Interruption.cpp Tabulation.cpp + DebugSession.cpp DbU.cpp Point.cpp Box.cpp diff --git a/hurricane/src/hurricane/CellCollections.cpp b/hurricane/src/hurricane/CellCollections.cpp index ba108dc4..64c46d18 100644 --- a/hurricane/src/hurricane/CellCollections.cpp +++ b/hurricane/src/hurricane/CellCollections.cpp @@ -928,6 +928,7 @@ class Cell_OccurrencesUnder : public Collection { private: ComponentLocator _componentLocator; private: RubberLocator _rubberLocator; private: MarkerLocator _markerLocator; + private: GoLocator _extensionGoLocator; private: InstanceLocator _instanceLocator; private: OccurrenceLocator _occurrenceLocator; @@ -2870,6 +2871,7 @@ Cell_OccurrencesUnder::Locator::Locator() _componentLocator(), _rubberLocator(), _markerLocator(), + _extensionGoLocator(), _instanceLocator(), _occurrenceLocator() { @@ -2885,6 +2887,7 @@ Cell_OccurrencesUnder::Locator::Locator(const Cell* cell, const Box& area, unsig _componentLocator(), _rubberLocator(), _markerLocator(), + _extensionGoLocator(), _instanceLocator(), _occurrenceLocator() { @@ -2901,9 +2904,14 @@ Cell_OccurrencesUnder::Locator::Locator(const Cell* cell, const Box& area, unsig if (_markerLocator.isValid()) _state = 3; else { - _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); - if (_instanceLocator.isValid()) + _extensionGoLocator = _cell->getExtensionGosUnder(_area).getLocator(); + if (_extensionGoLocator.isValid()) _state = 4; + else { + _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); + if (_instanceLocator.isValid()) + _state = 5; + } } } } @@ -2920,6 +2928,7 @@ Cell_OccurrencesUnder::Locator::Locator(const Locator& locator) _componentLocator(locator._componentLocator), _rubberLocator(locator._rubberLocator), _markerLocator(locator._markerLocator), + _extensionGoLocator(locator._extensionGoLocator), _instanceLocator(locator._instanceLocator), _occurrenceLocator(locator._occurrenceLocator) { @@ -2935,6 +2944,7 @@ Cell_OccurrencesUnder::Locator& Cell_OccurrencesUnder::Locator::operator=(const _componentLocator = locator._componentLocator; _rubberLocator = locator._rubberLocator; _markerLocator = locator._markerLocator; + _extensionGoLocator = locator._extensionGoLocator; _instanceLocator = locator._instanceLocator; _occurrenceLocator = locator._occurrenceLocator; return *this; @@ -2948,8 +2958,9 @@ Occurrence Cell_OccurrencesUnder::Locator::getElement() const case 1 : return Occurrence(_componentLocator.getElement()); case 2 : return Occurrence(_rubberLocator.getElement()); case 3 : return Occurrence(_markerLocator.getElement()); - case 4 : return Occurrence(_instanceLocator.getElement()); - case 5 : { + case 4 : return Occurrence(_extensionGoLocator.getElement()); + case 5 : return Occurrence(_instanceLocator.getElement()); + case 6 : { Occurrence occurrence = _occurrenceLocator.getElement(); Entity* entity = occurrence.getEntity(); Path path = Path(_instanceLocator.getElement(), occurrence.getPath()); @@ -2988,11 +2999,16 @@ void Cell_OccurrencesUnder::Locator::progress() if (_markerLocator.isValid()) _state = 3; else { - _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); - if (_instanceLocator.isValid()) + _extensionGoLocator = _cell->getExtensionGosUnder(_area).getLocator(); + if (_extensionGoLocator.isValid()) _state = 4; - else + else { + _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); + if (_instanceLocator.isValid()) + _state = 5; + else _state = 0; + } } } } @@ -3004,25 +3020,45 @@ void Cell_OccurrencesUnder::Locator::progress() if (_markerLocator.isValid()) _state = 3; else { - _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); - if (_instanceLocator.isValid()) + _extensionGoLocator = _cell->getExtensionGosUnder(_area).getLocator(); + if (_extensionGoLocator.isValid()) _state = 4; - else + else { + _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); + if (_instanceLocator.isValid()) + _state = 5; + else _state = 0; + } } } break; case 3 : _markerLocator.progress(); if (!_markerLocator.isValid()) { - _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); - if (_instanceLocator.isValid()) + _extensionGoLocator = _cell->getExtensionGosUnder(_area).getLocator(); + if (_extensionGoLocator.isValid()) _state = 4; - else + else { + _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); + if (_instanceLocator.isValid()) + _state = 5; + else _state = 0; + } } break; case 4 : + _extensionGoLocator.progress(); + if (!_extensionGoLocator.isValid()) { + _instanceLocator = _cell->getInstancesUnder(_area).getLocator(); + if (_instanceLocator.isValid()) + _state = 5; + else + _state = 0; + } + break; + case 5 : if (!_searchDepth) { _instanceLocator.progress(); if (!_instanceLocator.isValid()) _state = 0; @@ -3040,7 +3076,7 @@ void Cell_OccurrencesUnder::Locator::progress() _occurrenceLocator = masterCell->getOccurrencesUnder(masterArea, _searchDepth - 1).getLocator(); if (_occurrenceLocator.isValid()) - _state = 5; + _state = 6; else { _instanceLocator.progress(); if (!_instanceLocator.isValid()) _state = 0; @@ -3048,12 +3084,12 @@ void Cell_OccurrencesUnder::Locator::progress() } } break; - case 5 : + case 6 : _occurrenceLocator.progress(); if (!_occurrenceLocator.isValid()) { _instanceLocator.progress(); if (_instanceLocator.isValid()) - _state = 4; + _state = 5; else _state = 0; } diff --git a/hurricane/src/hurricane/DebugSession.cpp b/hurricane/src/hurricane/DebugSession.cpp new file mode 100644 index 00000000..2caaeae1 --- /dev/null +++ b/hurricane/src/hurricane/DebugSession.cpp @@ -0,0 +1,103 @@ + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | V L S I B a c k e n d D a t a - B a s e | +// | | +// | Author : Jean-Paul Chaput | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Module : "./DebugSession.cpp" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + + +#include +#include + +#include "hurricane/Warning.h" +#include "hurricane/Name.h" +#include "hurricane/Cell.h" +#include "hurricane/DebugSession.h" + + + + +namespace Hurricane { + + +// ------------------------------------------------------------------- +// Class : "Hurricane::DebugSession". + + + DebugSession* DebugSession::_singleton = DebugSession::create (); + + + DebugSession* DebugSession::create () + { + if ( !_singleton ) + _singleton = new DebugSession (); + return _singleton; + } + + + DebugSession::DebugSession () + : _symbols() + , _levels() + { } + + + DebugSession::~DebugSession () + { } + + + void DebugSession::_addToTrace ( const Cell* cell, const Name& name ) + { + Net* net = cell->getNet ( name ); + if ( net ) + _addToTrace ( net ); + else + cerr << Warning ( "DebugSession::_addToTrace(): %s do not contain Net %s." + , getString(cell).c_str(), getString(name).c_str() ) << endl; + } + + + string DebugSession::_getTypeName () const + { + return _TName("DebugSession"); + } + + + string DebugSession::_getString () const + { + string s = "<" + _getTypeName() + + " " + getString(_symbols.size()) + + " " + getString(_levels.size()) + + ">"; + return s; + } + + + Record* DebugSession::_getRecord () const + { + Record* record = new Record ( this->_getString() ); + record->add ( getSlot ( "_symbols", &_symbols ) ); + //record->add ( getSlot ( "_levels" , &_levels ) ); + + return record; + } + + +} // End of Hurricane namespace. diff --git a/hurricane/src/hurricane/SlotAdapter.cpp b/hurricane/src/hurricane/SlotAdapter.cpp deleted file mode 100644 index 38df345d..00000000 --- a/hurricane/src/hurricane/SlotAdapter.cpp +++ /dev/null @@ -1,65 +0,0 @@ - - -// -*- C++ -*- -// -// This file is part of the Coriolis Project. -// Copyright (C) Laboratoire LIP6 - Departement ASIM -// Universite Pierre et Marie Curie -// -// Main contributors : -// Christophe Alexandre -// Hugo Clément -// Jean-Paul Chaput -// Christian Masson -// -// The Coriolis Project is free software; you can redistribute it -// and/or modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// The Coriolis Project is distributed in the hope that it will be -// useful, but WITHOUT ANY WARRANTY; without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with the Coriolis Project; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA -// -// License-Tag -// Authors-Tag -// =================================================================== -// -// $Id: SlotAdapter.cpp,v 1.1 2007/07/29 15:25:01 jpc Exp $ -// -// x-----------------------------------------------------------------x -// | | -// | H U R R I C A N E | -// | V L S I B a c k e n d D a t a - B a s e | -// | | -// | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | -// | =============================================================== | -// | C++ Module : "./DataSlotAdapter.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x - - - - -# include "hurricane/Commons.h" - - - -namespace Hurricane { - - -// x-----------------------------------------------------------------x -// | DataSlotAdapter Global Variables | -// x-----------------------------------------------------------------x - - -} // End of Hurricane namespace. diff --git a/hurricane/src/hurricane/hurricane/Bug.h b/hurricane/src/hurricane/hurricane/Bug.h new file mode 100644 index 00000000..250afdb3 --- /dev/null +++ b/hurricane/src/hurricane/hurricane/Bug.h @@ -0,0 +1,72 @@ + +// -*- C++ -*- +// +// This file is part of the Hurricane Software. +// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | H U R R I C A N E | +// | V L S I B a c k e n d D a t a - B a s e | +// | | +// | Author : Remy Escassut | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Header : "./Bug.h" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +# ifndef __HURRICANE_BUG__ +# define __HURRICANE_BUG__ + +# include "hurricane/Exception.h" + + +namespace Hurricane { + + + class Bug : public Exception { + + public: + // Constructors. + Bug ( const string& reason ); + Bug ( const char* format, ... ); + Bug ( int code, const string& reason ); + Bug ( int code, const char* format, ... ); + Bug ( const Bug& error ); + // Methods. + inline string getReason () const; + inline int getCode () const; + // Hurricane Managment. + virtual string _getTypeName () const; + virtual string _getString () const; + + private: + // Internal: Attributes. + string _reason; + int _code; + }; + + +// Inline Functions. + inline string Bug::getReason () const { return _reason; } + inline int Bug::getCode () const { return _code; } + + +} // End of Hurricane namespace. + + +GETSTRING_POINTER_SUPPORT(Hurricane::Bug); +GETSTRING_VALUE_SUPPORT(Hurricane::Bug); +IOSTREAM_POINTER_SUPPORT(Hurricane::Bug); +IOSTREAM_VALUE_SUPPORT(Hurricane::Bug); + + +# endif // __HURRICANE_BUG__ diff --git a/hurricane/src/hurricane/hurricane/Collection.h b/hurricane/src/hurricane/hurricane/Collection.h index 4a684405..1a673888 100644 --- a/hurricane/src/hurricane/hurricane/Collection.h +++ b/hurricane/src/hurricane/hurricane/Collection.h @@ -823,6 +823,7 @@ class ForEachIterator { inline ForEachIterator ( GenericCollection coll ); inline bool isValid (); inline Element operator* (); + inline Element operator-> (); inline ForEachIterator& operator++ (int); public: GenericCollection& collection; @@ -856,6 +857,13 @@ inline Element ForEachIterator::operator* () } +template< typename Element > +inline Element ForEachIterator::operator-> () +{ + return element; +} + + template< typename Element > inline ForEachIterator& ForEachIterator::operator++ (int) { diff --git a/hurricane/src/hurricane/hurricane/DebugSession.h b/hurricane/src/hurricane/hurricane/DebugSession.h new file mode 100644 index 00000000..80df0a22 --- /dev/null +++ b/hurricane/src/hurricane/hurricane/DebugSession.h @@ -0,0 +1,127 @@ + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | V L S I B a c k e n d D a t a - B a s e | +// | | +// | Author : Jean-Paul Chaput | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Header : "./DebugSession.h" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +#ifndef __HURRICANE_DEBUG_SESSION_H__ +#define __HURRICANE_DEBUG_SESSION_H__ + + +#include +#include + +#include "hurricane/Commons.h" + + +namespace Hurricane { + + + class Name; + class Net; + class Cell; + + using std::set; + using std::stack; + + +// ------------------------------------------------------------------- +// Class : "Hurricane::DebugSession". + + + class DebugSession { + + public: + // Static Access. + static DebugSession* create (); + static inline DebugSession* get (); + static inline bool isTraced ( const void* symbol ); + static inline void isTracedNet ( const Net* ); + static inline void addToTrace ( const void* symbol ); + static inline void addToTrace ( const Cell*, const Name& ); + static inline void addToTrace ( const Net* ); + static inline void open ( const void* symbol, unsigned int traceLevel=80 ); + static inline void close (); + // Singleton Access. + inline bool _isTraced ( const void* symbol ) const; + inline void _addToTrace ( const void* symbol ); + void _addToTrace ( const Cell*, const Name& ); + inline void _addToTrace ( const Net* net ); + // Inspector Management. + Record* _getRecord () const; + string _getString () const; + string _getTypeName () const; + + protected: + // Internal: Attributes. + static DebugSession* _singleton; + set _symbols; + stack _levels; + + protected: + // Internal: Constructor & Destructor. + DebugSession (); + ~DebugSession (); + private: + DebugSession ( const DebugSession& ); + DebugSession& operator= ( const DebugSession& ); + }; + + +// Inline Functions. + + + void DebugSession::open ( const void* symbol, unsigned int traceLevel ) + { + if ( _singleton->_isTraced(symbol) ) + _singleton->_levels.push ( ltracelevel(traceLevel) ); + } + + + void DebugSession::close () + { + if ( !_singleton->_levels.empty() ) { + ltracelevel ( _singleton->_levels.top() ); + _singleton->_levels.pop (); + } + } + + + DebugSession* DebugSession::get () { return _singleton; } + bool DebugSession::isTraced ( const void* symbol ) { return _singleton->_isTraced(symbol); } + void DebugSession::addToTrace ( const void* symbol ) { _singleton->_addToTrace(symbol); } + void DebugSession::addToTrace ( const Net* net ) { _singleton->_addToTrace ( net ); } + void DebugSession::addToTrace ( const Cell* cell + , const Name& name ) { _singleton->_addToTrace ( cell, name ); } + bool DebugSession::_isTraced ( const void* symbol ) const { return _symbols.find(symbol) != _symbols.end(); } + void DebugSession::_addToTrace ( const void* symbol ) { _symbols.insert ( symbol ); } + void DebugSession::_addToTrace ( const Net* net ) { _addToTrace ( static_cast(net) ); } + + + +} // End of Hurricane namespace. + + +INSPECTOR_P_SUPPORT(Hurricane::DebugSession); + + +#endif // __HURRICANE_DEBUG_SESSION__ diff --git a/hurricane/src/hurricane/hurricane/Mask.h b/hurricane/src/hurricane/hurricane/Mask.h index 0e6c5253..72a3881a 100644 --- a/hurricane/src/hurricane/hurricane/Mask.h +++ b/hurricane/src/hurricane/hurricane/Mask.h @@ -43,6 +43,7 @@ namespace Hurricane { inline Mask& unset ( const Mask mask ); inline bool contains ( const Mask mask ) const; inline bool intersect ( const Mask mask ) const; + inline Mask& merge ( const Mask mask ) const; inline Mask nthbit ( unsigned int ) const; inline Mask operator compl () const; inline Mask operator bitand ( const Mask mask ) const; diff --git a/hurricane/src/hurricane/hurricane/RoutingPad.h b/hurricane/src/hurricane/hurricane/RoutingPad.h index 6c05144d..d2a2f196 100644 --- a/hurricane/src/hurricane/hurricane/RoutingPad.h +++ b/hurricane/src/hurricane/hurricane/RoutingPad.h @@ -103,4 +103,7 @@ RoutingPad* createRoutingPad ( Pin* pin ); } // End of Hurricane namespace. + +INSPECTOR_P_SUPPORT(Hurricane::RoutingPad); + #endif // HURRICANE_ROUTINGPAD diff --git a/hurricane/src/hurricane/hurricane/SlotAdapter.h b/hurricane/src/hurricane/hurricane/SlotAdapter.h deleted file mode 100644 index 6cbc195d..00000000 --- a/hurricane/src/hurricane/hurricane/SlotAdapter.h +++ /dev/null @@ -1,307 +0,0 @@ - - -// -*- C++ -*- -// -// This file is part of the Coriolis Project. -// Copyright (C) Laboratoire LIP6 - Departement ASIM -// Universite Pierre et Marie Curie -// -// Main contributors : -// Christophe Alexandre -// Hugo Clément -// Jean-Paul Chaput -// Christian Masson -// -// The Coriolis Project is free software; you can redistribute it -// and/or modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// The Coriolis Project is distributed in the hope that it will be -// useful, but WITHOUT ANY WARRANTY; without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with the Coriolis Project; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA -// -// License-Tag -// Authors-Tag -// =================================================================== -// -// $Id: SlotAdapter.h,v 1.7 2007/07/30 14:44:45 jpc Exp $ -// -// x-----------------------------------------------------------------x -// | | -// | H U R R I C A N E | -// | V L S I B a c k e n d D a t a - B a s e | -// | | -// | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | -// | =============================================================== | -// | C++ Header : "./SlotAdapter.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x - - - - -#ifndef __SLOT_ADAPTER__ -#define __SLOT_ADAPTER__ - - -#ifndef __HURRICANE_COMMONS__ -#error "SlotAdapter.h musn't be included alone, please uses Commons.h." -#endif - - - -#include - - - -namespace Hurricane { - - - using namespace std; - - - class Record; - - -} // End of Hurricane namespace. - - - - -// x-----------------------------------------------------------------x -// | Generic Functions for Slot Managment | -// x-----------------------------------------------------------------x - -// Note 1: we are outside the Hurricane namespace. -// Note 2: thoses templates manage all types. - - -template inline std::string getString ( Data* data ) { return "getString() - Unsupported data"; } -template inline std::string getString ( Data& data ) { return "getString() - Unsupported data"; } -template inline Hurricane::Record* getRecord ( Data* data ) { return NULL; } -template inline Hurricane::Record* getRecord ( Data& data ) { return NULL; } - -template<> inline std::string getString ( const std::string* s ) { return *s; } -template<> inline std::string getString ( const char* c ) { return c; } -template<> inline std::string getString ( const char c) { return std::string(1,c); } -template<> inline std::string getString ( const char c) { return std::string(1,c); } -template<> inline std::string getString ( const bool* b ) { return (*b)?"True":"False" ; } - -template<> inline std::string getString ( const void* p ) -{ ostringstream os ("0x"); return (os << hex << p).str(); } - -template<> inline std::string getString ( const int* i ) -{ ostringstream os (""); return (os << *i).str(); } - -template<> inline std::string getString ( const long* l ) -{ ostringstream os (""); return (os << *l).str(); } - -template<> inline std::string getString ( const unsigned int* u ) -{ ostringstream os (""); return (os << *u).str(); } - -template<> inline std::string getString ( const unsigned long* ul ) -{ ostringstream os (""); return (os << *ul).str() } - -template<> inline std::string ProxyString ( const unsigned long long* ull ) -{ ostringstream os (""); return (os << *ull).str(); } - -template<> inline std::string getString ( const unsigned short int* us ) -{ ostringstream os (""); return (os << *us).str(); } - -template<> inline std::string getString ( const float* f ) -{ ostringstream os (""); return (os << *f).str(); } - -template<> inline std::string getString ( const double* d ) -{ ostringstream os; return (os << *d).str(); } - - -template -inline Hurricane::Slot* getSlot ( const std::string& name, const Data* d ) -{ - if ( !d ) return getSlot ( name, "NULL pointer" ); - - return new PointerSlot ( name, d ); -} - -template -inline Hurricane::Slot* getSlot( const std::string& name, const Data d ) -{ - return new Hurricane::ValueSlot ( name, d ); -} - - -template -inline ostream& operator<< ( ostream& o, const Data* d ) -{ - if (!d) return o << "NULL"; - - return o << "&" << getString(d); -} - - -template -inline ostream& operator<< ( ostream& o, const Data d ) -{ - return o << "&" << getString(d); -} - - -# include "hurricane/Record.h" -# include "hurricane/Slot.h" - - -// ------------------------------------------------------------------- -// Inspector Support for : "const vector*". - - -template -inline std::string getString*>( const vector* v ) -{ - std::string name = "vector:"; - return name + getString(v->size()); -} - - -template -inline Hurricane::Record* getRecord*>( const vector* v ) -{ - Hurricane::Record* record = NULL; - if ( !v->empty() ) { - record = new Hurricane::Record ( "vector" ); - unsigned n = 1; - typename vector::const_iterator iterator = v->begin(); - while ( iterator != v->end() ) { - record->add ( getSlot(getString(n++), *iterator) ); - ++iterator; - } - } - return record; -} - - -// ------------------------------------------------------------------- -// Inspector Support for : "const list*". - - -template -inline std::string getString*>( const list* l ) -{ - std::string name = "list:"; - return name + getString(l->size()); -} - - -template -inline Hurricane::Record* getRecord*>( const list* l ) -{ - Hurricane::Record* record = NULL; - if ( !l->empty() ) { - record = new Hurricane::Record ( "list" ); - unsigned n = 1; - typename list::const_iterator iterator = l->begin(); - while ( iterator != l->end() ) { - record->add ( getSlot(getString(n++), *iterator) ); - ++iterator; - } - } - return record; -} - - -// ------------------------------------------------------------------- -// Inspector Support for : "const map*. - - -template -inline std::string getString*>( const map* m ) -{ - std::string name = "map:"; - return name + getString(m->size()); -} - - -template -inline Hurricane::Record* getRecord*>( const map* m ) -{ - Hurricane::Record* record = NULL; - if ( !m->empty() ) { - record = new Hurricane::Record ( "map" ); - typename map::const_iterator iterator = m->begin(); - while ( iterator != m->end() ) { - record->add ( getSlot(getString(iterator->first), iterator->second) ); - ++iterator; - } - } - return record; -} - - -// ------------------------------------------------------------------- -// Inspector Support for : "const set*". - - -template -inline std::string getString*>( const set* s ) -{ - std::string name = "set:"; - return name + getString(s->size()); -} - - -template -inline Hurricane::Record* getRecord*>( const set* s ) -{ - Hurricane::Record* record = NULL; - if ( !s->empty() ) { - record = new Hurricane::Record ( "set" ); - unsigned n = 1; - typename set::const_iterator iterator = s->begin(); - while ( iterator != s->end() ) { - record->add ( getSlot(getString(n++), *iterator) ); - ++iterator; - } - } - return record; -} - - -// ------------------------------------------------------------------- -// Inspector Support for : "const multiset*". - - -template -inline std::string getString*>( const multiset* s ) -{ - std::string name = "multiset:"; - return name + getString(s->size()); -} - - -template -inline Hurricane::Record* getRecord*>( const multiset* s ) -{ - Hurricane::Record* record = NULL; - if ( !s->empty() ) { - record = new Hurricane::Record ( "multiset" ); - unsigned n = 1; - typename multiset::const_iterator iterator = s->begin(); - while ( iterator != s->end() ) { - record->add ( getSlot(getString(n++), *iterator) ); - ++iterator; - } - } - return record; -} - - -#endif diff --git a/hurricane/src/hviewer/HExtensionPaletteEntry.cpp b/hurricane/src/hviewer/HExtensionPaletteEntry.cpp index 1bd4aa50..83061902 100644 --- a/hurricane/src/hviewer/HExtensionPaletteEntry.cpp +++ b/hurricane/src/hviewer/HExtensionPaletteEntry.cpp @@ -57,7 +57,7 @@ namespace Hurricane { layout->setContentsMargins ( 0, 0, 0, 0 ); _checkBox = new QCheckBox ( this ); - _checkBox->setChecked ( true ); + _checkBox->setChecked ( false ); _checkBox->setText ( getString(getName()).c_str() ); _checkBox->setFont ( Graphics::getFixedFont() ); layout->addWidget ( _checkBox ); diff --git a/hurricane/src/hviewer/SelectCommand.cpp b/hurricane/src/hviewer/SelectCommand.cpp index 5e66bfdb..1f6561e9 100644 --- a/hurricane/src/hviewer/SelectCommand.cpp +++ b/hurricane/src/hviewer/SelectCommand.cpp @@ -1,36 +1,9 @@ // -*- C++ -*- // -// This file is part of the Coriolis Project. -// Copyright (C) Laboratoire LIP6 - Departement ASIM -// Universite Pierre et Marie Curie +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved // -// Main contributors : -// Christophe Alexandre -// Sophie Belloeil -// Hugo Clément -// Jean-Paul Chaput -// Damien Dupuis -// Christian Masson -// Marek Sroka -// -// The Coriolis Project is free software; you can redistribute it -// and/or modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// The Coriolis Project is distributed in the hope that it will be -// useful, but WITHOUT ANY WARRANTY; without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with the Coriolis Project; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA -// -// License-Tag -// Authors-Tag // =================================================================== // // $Id$