* ./hurricane/src/hurricane :

- New : DebugSession for a selective trace activation, based on "symbols",
        that is, void pointers to objects.
    - New : ExtensionGos are now selectables (integrated to the
        Cell_OccurrencesUnder collection). Note that they are manageds as Gos
        and *not* ExtensionGos.
    - New : Bug flavor of Exception (sibling of Error & Warning).

  * ./hurricane/src/hviewer :
    - Change : ExtensionGos are now hidden by default.
This commit is contained in:
Jean-Paul Chaput 2008-11-12 12:18:24 +00:00
parent e370e8ac1c
commit f2c60cf6c9
13 changed files with 478 additions and 419 deletions

View File

@ -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 <cstdarg>
# 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.

View File

@ -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

View File

@ -928,6 +928,7 @@ class Cell_OccurrencesUnder : public Collection<Occurrence> {
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;
}

View File

@ -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 <cstdlib>
#include <sstream>
#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.

View File

@ -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 <Christophe.Alexandre@lip6.fr>
// Hugo Clément <Hugo.Clement@lip6.fr>
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
// Christian Masson <Christian.Masson@lip6.fr>
//
// 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.

View File

@ -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__

View File

@ -823,6 +823,7 @@ class ForEachIterator {
inline ForEachIterator ( GenericCollection<Element> coll );
inline bool isValid ();
inline Element operator* ();
inline Element operator-> ();
inline ForEachIterator& operator++ (int);
public:
GenericCollection<Element>& collection;
@ -856,6 +857,13 @@ inline Element ForEachIterator<Element>::operator* ()
}
template< typename Element >
inline Element ForEachIterator<Element>::operator-> ()
{
return element;
}
template< typename Element >
inline ForEachIterator<Element>& ForEachIterator<Element>::operator++ (int)
{

View File

@ -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 <set>
#include <stack>
#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<const void*> _symbols;
stack<unsigned int> _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<const void*>(net) ); }
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::DebugSession);
#endif // __HURRICANE_DEBUG_SESSION__

View File

@ -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;

View File

@ -103,4 +103,7 @@ RoutingPad* createRoutingPad ( Pin* pin );
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::RoutingPad);
#endif // HURRICANE_ROUTINGPAD

View File

@ -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 <Christophe.Alexandre@lip6.fr>
// Hugo Clément <Hugo.Clement@lip6.fr>
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
// Christian Masson <Christian.Masson@lip6.fr>
//
// 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 <sstream>
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<typename Data> inline std::string getString ( Data* data ) { return "getString() - Unsupported data"; }
template<typename Data> inline std::string getString ( Data& data ) { return "getString() - Unsupported data"; }
template<typename Data> inline Hurricane::Record* getRecord ( Data* data ) { return NULL; }
template<typename Data> inline Hurricane::Record* getRecord ( Data& data ) { return NULL; }
template<> inline std::string getString<const std::string*> ( const std::string* s ) { return *s; }
template<> inline std::string getString<const char*> ( const char* c ) { return c; }
template<> inline std::string getString<const char> ( const char c) { return std::string(1,c); }
template<> inline std::string getString<char> ( const char c) { return std::string(1,c); }
template<> inline std::string getString<const bool*> ( const bool* b ) { return (*b)?"True":"False" ; }
template<> inline std::string getString<const void*> ( const void* p )
{ ostringstream os ("0x"); return (os << hex << p).str(); }
template<> inline std::string getString<const int*> ( const int* i )
{ ostringstream os (""); return (os << *i).str(); }
template<> inline std::string getString<const long*> ( const long* l )
{ ostringstream os (""); return (os << *l).str(); }
template<> inline std::string getString<const unsigned int*> ( const unsigned int* u )
{ ostringstream os (""); return (os << *u).str(); }
template<> inline std::string getString<const unsigned long*> ( const unsigned long* ul )
{ ostringstream os (""); return (os << *ul).str() }
template<> inline std::string ProxyString<const unsigned long long*> ( const unsigned long long* ull )
{ ostringstream os (""); return (os << *ull).str(); }
template<> inline std::string getString<unsigned short int*> ( const unsigned short int* us )
{ ostringstream os (""); return (os << *us).str(); }
template<> inline std::string getString<const float*> ( const float* f )
{ ostringstream os (""); return (os << *f).str(); }
template<> inline std::string getString<const double* d> ( const double* d )
{ ostringstream os; return (os << *d).str(); }
template<typename Data>
inline Hurricane::Slot* getSlot ( const std::string& name, const Data* d )
{
if ( !d ) return getSlot ( name, "NULL pointer" );
return new PointerSlot<Data> ( name, d );
}
template<typename Data>
inline Hurricane::Slot* getSlot( const std::string& name, const Data d )
{
return new Hurricane::ValueSlot<Data> ( name, d );
}
template<typename Data>
inline ostream& operator<< ( ostream& o, const Data* d )
{
if (!d) return o << "NULL";
return o << "&" << getString(d);
}
template<typename Data>
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<Element>*".
template<typename Element>
inline std::string getString<const vector<Element>*>( const vector<Element>* v )
{
std::string name = "vector<Element>:";
return name + getString(v->size());
}
template<typename Element>
inline Hurricane::Record* getRecord<const vector<Element>*>( const vector<Element>* v )
{
Hurricane::Record* record = NULL;
if ( !v->empty() ) {
record = new Hurricane::Record ( "vector<Element>" );
unsigned n = 1;
typename vector<Element>::const_iterator iterator = v->begin();
while ( iterator != v->end() ) {
record->add ( getSlot(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "const list<Element>*".
template<typename Element>
inline std::string getString<const list<Element>*>( const list<Element>* l )
{
std::string name = "list<Element>:";
return name + getString(l->size());
}
template<typename Element>
inline Hurricane::Record* getRecord<const list<Element>*>( const list<Element>* l )
{
Hurricane::Record* record = NULL;
if ( !l->empty() ) {
record = new Hurricane::Record ( "list<Element>" );
unsigned n = 1;
typename list<Element>::const_iterator iterator = l->begin();
while ( iterator != l->end() ) {
record->add ( getSlot(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "const map<Key,Element,Compare>*.
template<typename Key, typename Element, typename Compare>
inline std::string getString<const map<Key,Element,Compare>*>( const map<Key,Element,Compare>* m )
{
std::string name = "map<Element>:";
return name + getString(m->size());
}
template<typename Key, typename Element, typename Compare>
inline Hurricane::Record* getRecord<const map <Key,Element,Compare>*>( const map<Key,Element,Compare>* m )
{
Hurricane::Record* record = NULL;
if ( !m->empty() ) {
record = new Hurricane::Record ( "map<Element>" );
typename map<Key,Element,Compare>::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<Element,Compare>*".
template<typename Element, typename Compare>
inline std::string getString<const set<Element,Compare>*>( const set<Element,Compare>* s )
{
std::string name = "set<Element>:";
return name + getString(s->size());
}
template<typename Element, typename Compare>
inline Hurricane::Record* getRecord<const set<Element,Compare>*>( const set<Element,Compare>* s )
{
Hurricane::Record* record = NULL;
if ( !s->empty() ) {
record = new Hurricane::Record ( "set<Element>" );
unsigned n = 1;
typename set<Element,Compare>::const_iterator iterator = s->begin();
while ( iterator != s->end() ) {
record->add ( getSlot(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "const multiset<Element,Compare>*".
template<typename Element, typename Compare>
inline std::string getString<const multiset<Element,Compare>*>( const multiset<Element,Compare>* s )
{
std::string name = "multiset<Element>:";
return name + getString(s->size());
}
template<typename Element, typename Compare>
inline Hurricane::Record* getRecord<const multiset<Element,Compare>*>( const multiset<Element,Compare>* s )
{
Hurricane::Record* record = NULL;
if ( !s->empty() ) {
record = new Hurricane::Record ( "multiset<Element>" );
unsigned n = 1;
typename multiset<Element,Compare>::const_iterator iterator = s->begin();
while ( iterator != s->end() ) {
record->add ( getSlot(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
#endif

View File

@ -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 );

View File

@ -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 <Christophe.Alexandre@lip6.fr>
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
// Hugo Clément <Hugo.Clement@lip6.fr>
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
// Damien Dupuis <Damien.Dupuis@lip6.fr>
// Christian Masson <Christian.Masson@lip6.fr>
// Marek Sroka <Marek.Sroka@lip6.fr>
//
// 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$