Derrick Release !!

* ./hurricane/src
   - Simplification of the Inspector internal mechanism. Simple, but with
       more templates, means a slower compilation.
   - The DbU::Unit problem : DbU::Unit are only typedef over long type,
       so we cannot create a specific overload for them. Uses "getValueRecord()"
       instead of "getRecord()"
   - For HInspectorWidget add a "getClone()" method. Also add a global
       object counter (for Record too) to track down memory leaks.
   - Big rewrite of the HInspectorWidget : now do not leak memory like hell,
       and only kept allocated the current Record and not the full stack
       of them (instead, we stack Slots which are ligthweigh objects).
   - Rename of "real" unit to "grid" unit.
   - New conversion function "getPhysicalsPerGrid()" and associated
       mechanism.

 * ./coriolis/src/crlcore :
   - Synchronise with the Hurricane modifications.
This commit is contained in:
Jean-Paul Chaput 2008-06-17 15:30:00 +00:00
parent 77d56ae638
commit a8b40f3b5c
97 changed files with 1994 additions and 1726 deletions

View File

@ -2,6 +2,7 @@
include ( ${QT_USE_FILE} )
include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane
${HURRICANE_SOURCE_DIR}/src/hviewer
${HURRICANE_SOURCE_DIR}/src/hinspector
)

View File

@ -1,135 +1,204 @@
#include <QFontMetrics>
#include <QComboBox>
#include <QLabel>
#include <QLineEdit>
#include <QTableView>
#include <QHeaderView>
#include <QSortFilterProxyModel>
#include <QKeyEvent>
#include <QGroupBox>
#include <QVBoxLayout>
#include "hurricane/viewer/Graphics.h"
#include "hurricane/inspector/RecordModel.h"
#include "hurricane/inspector/HInspectorWidget.h"
#include "hurricane/Slot.h"
HInspectorWidget::HInspectorWidget(QWidget* parent):
QWidget(parent),
filterProxyModels(),
filterProxyModelsHistory(),
recordsHistoryComboBox(NULL),
slotsView(NULL)
HInspectorWidget::HInspectorWidget ( Record* rootRecord, QWidget* parent )
: QWidget(parent)
, _slotsHistory()
, _recordModel(NULL)
, _sortModel(NULL)
, _recordsHistoryComboBox(NULL)
, _slotsView(NULL)
, _rowHeight(20)
, _rootRecord(rootRecord)
{
//recordsHistoryComboBox = new QComboBox(this);
setAttribute ( Qt::WA_DeleteOnClose );
_rowHeight = QFontMetrics(Graphics::getFixedFont()).height() + 4;
//recordsHistoryComboBox = new QComboBox(this);
slotsView = new QTableView(this);
slotsView->setAlternatingRowColors(true);
slotsView->setSelectionBehavior(QAbstractItemView::SelectRows);
slotsView->setSortingEnabled(true);
_slotsView = new QTableView(this);
_slotsView->setShowGrid(false);
_slotsView->setAlternatingRowColors(true);
_slotsView->setSelectionBehavior(QAbstractItemView::SelectRows);
_slotsView->setSortingEnabled(true);
QGridLayout* inspectorLayout = new QGridLayout();
//inspectorLayout->addWidget(recordsHistoryComboBox, 0, 0, 1, 2);
inspectorLayout->addWidget(slotsView, 1, 0, 1, 2);
QHeaderView* horizontalHeader = _slotsView->horizontalHeader ();
horizontalHeader->setStretchLastSection ( true );
horizontalHeader->setMinimumSectionSize ( 200 );
filterPatternLineEdit = new QLineEdit(this);
QLabel* filterPatternLabel = new QLabel(tr("&Filter pattern:"), this);
filterPatternLabel->setBuddy(filterPatternLineEdit);
QHeaderView* verticalHeader = _slotsView->verticalHeader ();
verticalHeader->setVisible ( false );
inspectorLayout->addWidget(filterPatternLabel, 2, 0);
inspectorLayout->addWidget(filterPatternLineEdit, 2, 1);
Slot* rootSlot = getSlot ( "TopLevelSlot", _rootRecord );
_slotsHistory.push_back ( rootSlot );
QGroupBox* inspectorGroupBox = new QGroupBox(tr("Hurricane inspector"), this);
inspectorGroupBox->setLayout(inspectorLayout);
_recordModel = new RecordModel ( rootSlot->getClone(), this );
_sortModel = new QSortFilterProxyModel ( this );
_sortModel->setSourceModel ( _recordModel );
_sortModel->setDynamicSortFilter ( true );
_sortModel->setFilterKeyColumn ( 1 );
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->addWidget(inspectorGroupBox);
setLayout(mainLayout);
_slotsView->setModel ( _sortModel );
_slotsView->horizontalHeader()->setStretchLastSection ( true );
_slotsView->resizeColumnToContents ( 0 );
//connect(recordsHistoryComboBox, SIGNAL(currentIndexChanged(int)),
// this, SLOT(recordChanged(int)));
int rows = _sortModel->rowCount ();
for ( rows-- ; rows >= 0 ; rows-- )
_slotsView->setRowHeight ( rows, _rowHeight );
connect(filterPatternLineEdit, SIGNAL(textChanged(const QString &)),
this, SLOT(textFilterChanged()));
QGridLayout* inspectorLayout = new QGridLayout();
//inspectorLayout->addWidget(recordsHistoryComboBox, 0, 0, 1, 2);
inspectorLayout->addWidget(_slotsView, 1, 0, 1, 2);
setWindowTitle(tr("Inspector"));
resize(1000, 500);
_filterPatternLineEdit = new QLineEdit(this);
QLabel* filterPatternLabel = new QLabel(tr("&Filter pattern:"), this);
filterPatternLabel->setBuddy(_filterPatternLineEdit);
inspectorLayout->addWidget(filterPatternLabel, 2, 0);
inspectorLayout->addWidget(_filterPatternLineEdit, 2, 1);
//QGroupBox* inspectorGroupBox = new QGroupBox(tr("Hurricane inspector"), this);
//inspectorGroupBox->setLayout(inspectorLayout);
//QVBoxLayout* mainLayout = new QVBoxLayout;
//mainLayout->addWidget(inspectorGroupBox);
//setLayout(mainLayout);
setLayout(inspectorLayout);
//connect(recordsHistoryComboBox, SIGNAL(currentIndexChanged(int)),
// this, SLOT(recordChanged(int)));
connect ( _filterPatternLineEdit
, SIGNAL(textChanged(const QString &))
, this
, SLOT(textFilterChanged())
);
setWindowTitle(tr("Inspector"));
resize(500, 300);
}
void HInspectorWidget::setRecord(Record* record) {
filterProxyModelsHistory.clear();
//recordsHistoryComboBox->clear();
internalSetRecord(record);
HInspectorWidget::~HInspectorWidget ()
{
//cerr << "HInspector::~HInspector() - " << hex << (void*)this << dec << endl;
clearHistory ();
//cerr << "Records: " << Record::getAllocateds() << endl;
//cerr << "Slots: " << Slot::getAllocateds() << endl;
}
void HInspectorWidget::internalSetRecord(Record* record) {
QSortFilterProxyModel* sortModel = NULL;
FilterProxyModels::iterator fpmit = filterProxyModels.find(record);
if (fpmit != filterProxyModels.end()) {
sortModel = fpmit->second;
} else {
RecordModel* recordModel = new RecordModel(record, this);
sortModel = new QSortFilterProxyModel(this);
sortModel->setDynamicSortFilter(true);
sortModel->setSourceModel(recordModel);
sortModel->setFilterKeyColumn(1);
filterProxyModels[record] = sortModel;
void HInspectorWidget::setRootRecord ( Record* record )
{
//recordsHistoryComboBox->clear();
clearHistory ();
_rootRecord = record;
Slot* rootSlot = getSlot("TopLevelRecord",record);
_slotsHistory.push_back ( rootSlot );
_recordModel->setSlot ( rootSlot->getClone(), _slotsHistory.size() );
}
void HInspectorWidget::clearHistory ()
{
if ( !_slotsHistory.empty() ) {
if ( _slotsHistory.size() > 1 )
delete _slotsHistory[0]->getDataRecord();
for ( size_t i=0 ; i < _slotsHistory.size() ; i++ )
delete _slotsHistory[i];
_slotsHistory.clear ();
}
}
bool HInspectorWidget::setSlot ( Slot* slot )
{
if ( !slot ) return false;
bool change = true;
//cerr << "HInspector::setSlot() - " << hex << (void*)slot << dec << endl;
change = _recordModel->setSlot ( slot, _slotsHistory.size() );
int rows = _sortModel->rowCount ();
for ( rows-- ; rows >= 0 ; rows-- )
_slotsView->setRowHeight ( rows, _rowHeight );
//cerr << "Records: " << Record::getAllocateds() << endl;
//cerr << "Slots: " << Slot::getAllocateds() << endl;
return change;
}
void HInspectorWidget::pushSlot ( Slot* slot )
{
//cerr << "pushSlot() - [clone of] " << hex << (void*)slot << dec << endl;
_slotsHistory.push_back ( slot->getClone() );
if ( !setSlot(slot->getClone()) ) {
//cerr << "pushSlot() cancelled" << endl;
delete _slotsHistory.back ();
_slotsHistory.pop_back ();
}
}
void HInspectorWidget::popSlot ()
{
if ( _slotsHistory.size() > 1 ) {
//cerr << "popSlot() - " << hex << (void*)_slotsHistory.back() << dec << endl;
//cerr << "popSlot() - " << _slotsHistory.back()->getDataString() << endl;
delete _slotsHistory.back ();
_slotsHistory.pop_back ();
setSlot ( _slotsHistory.back()->getClone() );
}
}
void HInspectorWidget::keyPressEvent(QKeyEvent *event)
{
if ( event->matches(QKeySequence::MoveToNextChar) ) {
QModelIndex index = _slotsView->currentIndex();
if ( index.isValid() ) {
Slot* slot = _recordModel->getRecord()->getSlot(_sortModel->mapToSource(index).row());
if ( slot )
pushSlot ( slot );
}
slotsView->setModel(sortModel);
slotsView->resizeColumnsToContents();
filterProxyModelsHistory.push_back(sortModel);
//recordsHistoryComboBox->addItem(QString(record->getName().c_str()));
//recordsHistoryComboBox->setCurrentIndex(recordsHistoryComboBox->count()-1);
} else if ( event->matches(QKeySequence::MoveToPreviousChar) ) {
popSlot ();
} else {
event->ignore();
}
}
void HInspectorWidget::keyPressEvent(QKeyEvent *event) {
if (event->matches(QKeySequence::MoveToNextChar)) {
QModelIndex index = slotsView->currentIndex();
if (index.isValid()) {
QSortFilterProxyModel* sortModel =
static_cast<QSortFilterProxyModel*>(slotsView->model());
QModelIndex modelIndex = sortModel->mapToSource(index);
RecordModel* recordModel =
static_cast<RecordModel*>(sortModel->sourceModel());
Record* record = recordModel->getRecord();
unsigned row = modelIndex.row();
Slot* slot = record->getSlot(row);
if (slot) {
Record* newRecord = slot->getDataRecord();
if (newRecord) {
internalSetRecord(newRecord);
}
}
}
} else if (event->matches(QKeySequence::MoveToPreviousChar)) {
if (!filterProxyModelsHistory.empty()) {
filterProxyModelsHistory.pop_back();
if (!filterProxyModelsHistory.empty()) {
QSortFilterProxyModel* proxyModel = filterProxyModelsHistory.back();
slotsView->setModel(proxyModel);
}
//unsigned count = recordsHistoryComboBox->count();
//if (count > 0) {
// recordsHistoryComboBox->removeItem(count-1);
//}
}
} else {
event->ignore();
}
}
void HInspectorWidget::recordChanged(size_t index) {
if (index >= 0 && index < filterProxyModelsHistory.size()) {
QSortFilterProxyModel* proxyModel = filterProxyModelsHistory[index];
slotsView->setModel(proxyModel);
//if (recordsHistoryComboBox->count() > index) {
// for (int i = recordsHistoryComboBox->count() - 1; i <= index; i--) {
// recordsHistoryComboBox->removeItem(i);
// }
//}
}
}
void HInspectorWidget::textFilterChanged() {
QRegExp regExp(filterPatternLineEdit->text());
QSortFilterProxyModel* sortModel =
static_cast<QSortFilterProxyModel*>(slotsView->model());
sortModel->setFilterRegExp(regExp);
void HInspectorWidget::textFilterChanged ()
{
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
}

View File

@ -1,34 +1,112 @@
#include "hurricane/inspector/RecordModel.h"
RecordModel::RecordModel(Record* r, QObject* parent):
QAbstractTableModel(parent),
record(r)
{}
#include <QFont>
#include <QApplication>
QVariant RecordModel::data(const QModelIndex &index, int role) const {
if (!index.isValid())
return QVariant();
#include "hurricane/Name.h"
#include "hurricane/viewer/Graphics.h"
#include "hurricane/inspector/RecordModel.h"
if (role != Qt::DisplayRole)
return QVariant();
unsigned row = index.row();
Slot* slot = record->getSlot(row);
if (slot) {
switch (index.column()) {
case 0:
return QVariant(getString(slot->getName()).c_str());
case 1:
return QVariant(slot->getDataString().c_str());
}
RecordModel::RecordModel ( Slot* slot, QObject* parent )
: QAbstractTableModel(parent)
, _slot(slot)
, _record(slot->getDataRecord())
, _depth(1)
{ }
RecordModel::~RecordModel ()
{
//cerr << "RecordModel::~RecordModel()" << endl;
delete _record;
delete _slot;
}
bool RecordModel::setSlot ( Slot* slot, size_t depth )
{
//cerr << "RecordModel::setSlot() " << _depth << " -> " << depth << endl;
//cerr << slot->getDataString() << endl;
Record* record = slot->getDataRecord ();
if ( !record ) {
//cerr << "RecordModel::setSlot() - Cancelling, NULL record" << endl;
delete slot;
return false;
}
emit layoutAboutToBeChanged ();
if ( _depth > 1 ) delete _record;
delete _slot;
_slot = slot;
_record = record;
_depth = depth;
emit layoutChanged ();
return true;
}
QVariant RecordModel::data ( const QModelIndex& index, int role ) const
{
static QFont nameFont = Graphics::getFixedFont ( QFont::Bold );
static QFont valueFont = Graphics::getFixedFont ( QFont::Normal, true );
if ( !index.isValid() ) return QVariant ();
if ( role == Qt::SizeHintRole ) {
switch (index.column()) {
case 0: return 200;
case 1: return -1;
}
}
if ( role == Qt::FontRole ) {
switch (index.column()) {
case 0: return nameFont;
case 1: return valueFont;
}
}
if ( role == Qt::DisplayRole ) {
int row = index.row ();
Slot* slot = _record->getSlot ( row );
if ( slot ) {
switch ( index.column() ) {
case 0: return QVariant(slot->getName ().c_str());
case 1: return QVariant(slot->getDataString().c_str());
}
}
}
return QVariant();
}
QVariant RecordModel::headerData ( int section
, Qt::Orientation orientation
, int role ) const
{
if ( ( orientation == Qt::Vertical ) || ( section > 1 ) || (role != Qt::DisplayRole) )
return QVariant();
if ( section == 0 )
return QVariant ( tr("Object Attribute") );
return QVariant ( tr("Value") );
}
int RecordModel::rowCount(const QModelIndex &parent) const {
return record->_getSlotList().size();
int RecordModel::rowCount ( const QModelIndex& parent ) const
{
return _record->_getSlotList().size();
}
int RecordModel::columnCount(const QModelIndex &parent) const {
return 2;
int RecordModel::columnCount ( const QModelIndex& parent ) const
{
return 2;
}

View File

@ -1,39 +1,53 @@
#ifndef HINSPECTORWIDGET_H
#define HINSPECTORWIDGET_H
#include "hurricane/Commons.h"
#ifndef __HINSPECTOR_WIDGET_H__
#define __HINSPECTOR_WIDGET_H__
#include "hurricane/Commons.h"
using namespace Hurricane;
#include <QWidget>
#include <QWidget>
class QSortFilterProxyModel;
class QTableView;
class QLineEdit;
class QComboBox;
class QHeaderView;
class RecordModel;
class HInspectorWidget : public QWidget {
Q_OBJECT
Q_OBJECT;
public:
typedef map<Record*, QSortFilterProxyModel*> FilterProxyModels;
typedef vector<QSortFilterProxyModel*> FilterProxyModelsHistory;
HInspectorWidget(QWidget* parent=0);
void setRecord(Record* record);
public:
typedef vector<Slot*> SlotsVector;
private slots:
void recordChanged(size_t index);
void textFilterChanged();
public:
HInspectorWidget ( Record* rootRecord, QWidget* parent=NULL );
~HInspectorWidget ();
void setRootRecord ( Record* record );
private slots:
void textFilterChanged ();
protected:
void keyPressEvent ( QKeyEvent * event );
private:
void clearHistory ();
void pushSlot ( Slot* slot );
void popSlot ();
bool setSlot ( Slot* slot );
protected:
void keyPressEvent(QKeyEvent * event);
private:
void internalSetRecord(Record* record);
FilterProxyModels filterProxyModels;
FilterProxyModelsHistory filterProxyModelsHistory;
QComboBox* recordsHistoryComboBox;
QTableView* slotsView;
QLineEdit* filterPatternLineEdit;
private:
SlotsVector _slotsHistory;
RecordModel* _recordModel;
QSortFilterProxyModel* _sortModel;
QComboBox* _recordsHistoryComboBox;
QTableView* _slotsView;
QLineEdit* _filterPatternLineEdit;
int _rowHeight;
Record* _rootRecord;
};
#endif // HINSPECTORWIDGET_H
#endif // __HINSPECTOR_WIDGET_H__

View File

@ -1,22 +1,39 @@
#ifndef RECORDMODEL_H
#define RECORDMODEL_H
#include <QAbstractTableModel>
#ifndef __RECORD_MODEL_H__
#define __RECORD_MODEL_H__
#include <QAbstractTableModel>
#include "hurricane/Commons.h"
#include "hurricane/Commons.h"
using namespace Hurricane;
class RecordModel : public QAbstractTableModel {
Q_OBJECT
public:
RecordModel(Record* record, QObject* parent=0);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
Record* getRecord() { return record; }
private:
Record* record;
class RecordModel : public QAbstractTableModel {
Q_OBJECT;
public:
RecordModel ( Slot* slot, QObject* parent=NULL );
~RecordModel ();
bool setSlot ( Slot* slot, size_t depth );
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
int columnCount ( const QModelIndex& parent=QModelIndex() ) const;
QVariant data ( const QModelIndex& index, int role=Qt::DisplayRole ) const;
QVariant headerData ( int section, Qt::Orientation orientation, int role=Qt::DisplayRole ) const;
inline Record* getRecord ();
inline Slot* getSlot ();
private:
Slot* _slot;
Record* _record;
size_t _depth;
};
#endif // RECORDMODEL_H
// Inline Functions.
inline Record* RecordModel::getRecord () { return _record; }
inline Slot* RecordModel::getSlot () { return _slot; }
#endif // __RECORD_MODEL_H__

View File

@ -255,8 +255,8 @@ Box& Box::shrinkByFactor(double factor)
// **************************************
{
assert((0.0 <= factor) && (factor <= 1.0));
DbU::Unit dx = DbU::real ( 0.5 * (1-factor) * (DbU::getReal(_xMax) - DbU::getReal(_xMin)) );
DbU::Unit dy = DbU::real ( 0.5 * (1-factor) * (DbU::getReal(_yMax) - DbU::getReal(_yMin)) );
DbU::Unit dx = DbU::grid ( 0.5 * (1-factor) * (DbU::getGrid(_xMax) - DbU::getGrid(_xMin)) );
DbU::Unit dy = DbU::grid ( 0.5 * (1-factor) * (DbU::getGrid(_yMax) - DbU::getGrid(_yMin)) );
//DbU::Unit dx=getUnit(0.5*(1- factor) * (getValue(_xMax) - getValue(_xMin)));
//DbU::Unit dy=getUnit(0.5*(1- factor) * (getValue(_yMax) - getValue(_yMin)));

View File

@ -78,69 +78,68 @@
hurricane/Views.h
hurricane/Warning.h
)
set ( cpps BasicLayer.cpp
set ( cpps Record.cpp
Slot.cpp
Commons.cpp
Exception.cpp
Error.cpp
DRCError.cpp
Warning.cpp
Interruption.cpp
Tabulation.cpp
DbU.cpp
Point.cpp
Box.cpp
Interval.cpp
Transformation.cpp
Name.cpp
DBo.cpp
DataBase.cpp
Technology.cpp
Layer.cpp
BasicLayer.cpp
RegularLayer.cpp
ViaLayer.cpp
ContactLayer.cpp
DiffusionLayer.cpp
TransistorLayer.cpp
Box.cpp
CellCollections.cpp
Cell.cpp
Commons.cpp
Component.cpp
Contact.cpp
DataBase.cpp
DBo.cpp
DeepNet.cpp
DisplaySlot.cpp
DRCError.cpp
Entity.cpp
Error.cpp
Exception.cpp
Go.cpp
Hook.cpp
Horizontal.cpp
HyperNet.cpp
Instance.cpp
Interruption.cpp
Interval.cpp
Layer.cpp
Library.cpp
Marker.cpp
Name.cpp
Entity.cpp
Cell.cpp
CellCollections.cpp
Net.cpp
NetExternalComponents.cpp
Occurrence.cpp
Pad.cpp
Path.cpp
Pin.cpp
DeepNet.cpp
HyperNet.cpp
Go.cpp
UserGo.cpp
Hook.cpp
Instance.cpp
Component.cpp
Plug.cpp
Point.cpp
Property.cpp
QuadTree.cpp
Quark.cpp
Record.cpp
Reference.cpp
Region.cpp
Relation.cpp
RoutingPad.cpp
Rubber.cpp
Contact.cpp
Pin.cpp
Segment.cpp
Vertical.cpp
Horizontal.cpp
Pad.cpp
RoutingPad.cpp
NetExternalComponents.cpp
Reference.cpp
Rubber.cpp
Quark.cpp
Property.cpp
Relation.cpp
SharedName.cpp
SharedPath.cpp
Path.cpp
Occurrence.cpp
QuadTree.cpp
Slice.cpp
SlotAdapter.cpp
Slot.cpp
Tabulation.cpp
Technology.cpp
Timer.cpp
Transformation.cpp
DbU.cpp
UpdateSession.cpp
UserGo.cpp
Vertical.cpp
Warning.cpp
Region.cpp
DisplaySlot.cpp
Marker.cpp
Timer.cpp
)
add_library ( hurricane SHARED ${cpps} )

View File

@ -261,6 +261,7 @@ Record* Cell::_getRecord() const
record->add(getSlot("Pins", &_pinMap));
record->add(getSlot("Slices", &_sliceMap));
record->add(getSlot("Markers", &_markerSet));
record->add(getSlot("SlaveEntityMap", &_slaveEntityMap));
record->add(getSlot("AbutmentBox", &_abutmentBox));
record->add(getSlot("BoundingBox", &_boundingBox));
record->add(getSlot("isTerminal", &_isTerminal));

View File

@ -112,6 +112,7 @@ string demangle ( const char* symbol )
// Generic functions
// ****************************************************************************************************
# if 0
bool Scan(const string& s, unsigned& u)
// ************************************
{
@ -215,6 +216,7 @@ bool Scan ( const string &s
return ( true );
}
# endif
// ****************************************************************************************************
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved

View File

@ -924,7 +924,7 @@ double getArea ( Component* component )
{
Box bb = component->getBoundingBox ();
return DbU::getReal(bb.getWidth()) * DbU::getReal(bb.getHeight());
return DbU::getGrid(bb.getWidth()) * DbU::getGrid(bb.getHeight());
}

View File

@ -10,6 +10,7 @@
#include "hurricane/BasicLayer.h"
#include "hurricane/Plug.h"
#include "hurricane/Error.h"
# include "hurricane/Slot.h"
namespace Hurricane {

View File

@ -145,11 +145,9 @@ string DBo::_getString() const
Record* DBo::_getRecord() const
// **********************
{
Record* record = new Record(getString(this));
if (record) {
record->add(getSlot("Properties", &_propertySet));
}
return record;
Record* record = new Record(getString(this));
record->add(getSlot("Properties", &_propertySet));
return record;
}
void DBo::_onDestroyed(Property* property)

View File

@ -77,7 +77,7 @@ Record* DataBase::_getRecord() const
record->add(getSlot("Technology", _technology));
record->add(getSlot("RootLibrary", _rootLibrary));
record->add(getSlot("Precision", DbU::getPrecision()));
record->add(getSlot("Resolution", DbU::getValueString(DbU::db(1))));
record->add(getSlot("Resolution", DbU::db(1)));
//record->add(getSlot("GridStep", getValueString(getGridStep())));
}
return record;

View File

@ -36,12 +36,47 @@ namespace Hurricane {
const unsigned int DbU::_maximalPrecision = 3;
unsigned int DbU::_precision = 1;
double DbU::_resolution = 0.1;
double DbU::_realsPerLambda = 10.0;
double DbU::_gridsPerLambda = 10.0;
double DbU::_physicalsPerGrid = 1.0;
unsigned int DbU::_stringMode = DbU::Symbolic;
const DbU::Unit DbU::Min = LONG_MIN;
const DbU::Unit DbU::Max = LONG_MAX;
// -------------------------------------------------------------------
// Class : "Hurricane::DbUSlot".
class DbUSlot : public Slot {
public:
// Constructor.
DbUSlot ( const string& name, const DbU::Unit* data );
DbUSlot ( string& name, const DbU::Unit* data );
// Accessors.
virtual string getDataString () const;
virtual Record* getDataRecord () const;
virtual DbUSlot* getClone () const;
protected:
// Internal: Attributes.
const DbU::Unit* _unit;
private:
// Internal: Constructors.
DbUSlot ( const DbUSlot& );
DbUSlot& operator= ( const DbUSlot& );
};
// Inline Member Functions.
DbUSlot::DbUSlot ( const string& name, const DbU::Unit* unit ) : Slot(name), _unit(unit) {}
DbUSlot::DbUSlot ( string& name, const DbU::Unit* unit ) : Slot(name), _unit(unit) {}
string DbUSlot::getDataString () const { return DbU::getValueString(*_unit); }
Record* DbUSlot::getDataRecord () const { return DbU::getValueRecord( _unit); }
DbUSlot* DbUSlot::getClone () const { return new DbUSlot(_name,_unit); }
// -------------------------------------------------------------------
// Class : "Hurricane::DbU".
@ -75,20 +110,44 @@ namespace Hurricane {
}
void DbU::setRealsPerLambda ( double realsPerLambda )
double DbU::getUnitPower ( UnitPower p )
{
if ( ( rint(realsPerLambda) != realsPerLambda )
|| ( remainder(realsPerLambda,2.0) != 0.0 ) )
throw Error ( "DbU::Unit::setRealPerLambdas(): \"realsPerLambda\" (%f) must be an even integer."
, realsPerLambda
);
_realsPerLambda = realsPerLambda;
switch ( p ) {
case Pico: return 1.0e-12;
case Nano: return 1.0e-9;
case Micro: return 1.0e-6;
case Milli: return 1.0e-3;
case Unity: return 1.0;
case Kilo: return 1.0e+3;
}
return 1.0;
}
double DbU::getRealsPerLambda ()
{ return _realsPerLambda; }
void DbU::setPhysicalsPerGrid ( double physicalsPerGrid, UnitPower p )
{
_physicalsPerGrid = physicalsPerGrid * getUnitPower(p);
}
double DbU::getPhysicalsPerGrid ()
{ return _physicalsPerGrid; }
void DbU::setGridsPerLambda ( double gridsPerLambda )
{
if ( ( rint(gridsPerLambda) != gridsPerLambda )
|| ( remainder(gridsPerLambda,2.0) != 0.0 ) )
throw Error ( "DbU::Unit::setGridPerLambdas(): \"gridsPerLambda\" (%f) must be an even integer."
, gridsPerLambda
);
_gridsPerLambda = gridsPerLambda;
}
double DbU::getGridsPerLambda ()
{ return _gridsPerLambda; }
@ -154,11 +213,11 @@ namespace Hurricane {
char buffer[1024];
char unitSymbol = 'u';
if ( _stringMode == Real ) {
if ( _stringMode == Grid ) {
if ( u == 0 ) return "0g";
unitSymbol = 'g';
snprintf ( buffer, 1024, "%.1f", getReal(u) );
snprintf ( buffer, 1024, "%.1f", getGrid(u) );
} else if ( _stringMode == Symbolic ) {
if ( u == 0 ) return "0l";
@ -185,4 +244,18 @@ namespace Hurricane {
}
Record* DbU::getValueRecord ( const DbU::Unit* u )
{
Record* record = new Record(getValueString(*u));
record->add(getSlot("DbU::Unit", u));
return record;
}
Slot* DbU::getValueSlot ( const string& name, const DbU::Unit* u )
{
return new DbUSlot ( name, u );
}
} // End of Hurricane namespace.

View File

@ -471,7 +471,7 @@ Record* Instance::_getRecord() const
record->add(getSlot("Name", &_name));
record->add(getSlot("MasterCell", _masterCell));
record->add(getSlot("Transformation", &_transformation));
record->add(getSlot("PlacementStatus", _placementStatus));
record->add(getSlot("PlacementStatus", &_placementStatus));
record->add(getSlot("XCenter", DbU::getValueString(getAbutmentBox().getXCenter())));
record->add(getSlot("YCenter", DbU::getValueString(getAbutmentBox().getYCenter())));
record->add(getSlot("Plugs", &_plugMap));

View File

@ -178,13 +178,6 @@ Record* Name::_getRecord() const
// Generic functions
// ****************************************************************************************************
bool Scan ( const string& s, Hurricane::Name& name )
// *****************************************
{
name = s;
return ( true );
}
// ****************************************************************************************************
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved

View File

@ -649,8 +649,8 @@ Record* Net::_getRecord() const
record->add(getSlot("Arity", &_arity));
record->add(getSlot("Global", &_isGlobal));
record->add(getSlot("External", &_isExternal));
record->add(getSlot("Type", _type));
record->add(getSlot("Direction", _direction));
record->add(getSlot("Type", &_type));
record->add(getSlot("Direction", &_direction));
record->add(getSlot("Position", &_position));
record->add(getSlot("Components", &_componentSet));
record->add(getSlot("Rubbers", &_rubberSet));

View File

@ -1,64 +1,84 @@
// ****************************************************************************************************
// File: Record.cpp
// Authors: R. Escassut
// -*- C++ -*-
//
// This file is part of the Hurricane Software.
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
// ****************************************************************************************************
//
// ===================================================================
//
// $Id: Record.h,v 1.7 2007/07/29 15:24:58 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 : Remy Escassut |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./Record.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include "hurricane/Commons.h"
namespace Hurricane {
// -------------------------------------------------------------------
// Class : "Hurricane::Record".
// ****************************************************************************************************
// Record implementation
// ****************************************************************************************************
Record::Record(const string& name)
// *******************************
: _name(name),
_slotList()
{
}
size_t Record::_allocateds = 0;
Record::~Record()
// **************
{
Record::Record ( const string& name )
: _name(name)
, _slotList()
{
_allocateds++;
}
Record::~Record ()
{
//cerr << "Record::~Record() - " << _name << ": " << hex << (void*)this << dec << endl;
while (!_slotList.empty()) {
Slot* slot = *_slotList.begin();
_slotList.remove(slot);
delete slot;
Slot* slot = *_slotList.begin();
_slotList.remove(slot);
delete slot;
}
}
_allocateds--;
}
Slot* Record::getSlot(unsigned no) const
// *************************************
{
size_t Record::getAllocateds ()
{
return _allocateds;
}
Slot* Record::getSlot ( unsigned no ) const
{
SlotList::const_iterator iterator = _slotList.begin();
while (no-- && (iterator != _slotList.end())) ++iterator;
return (iterator == _slotList.end()) ? NULL : *iterator;
}
void Record::add(Slot* slot)
// *************************
{
if (!slot) {
cerr << "[ERROR] Record::add(): Attempt to add NULL Slot." << endl;
return;
}
_slotList.push_back(slot);
}
string Record::_getString() const
// ******************************
{
return "<" + _TName("Record") + " " + getName() + ">";
}
void Record::add ( Slot* slot )
{
if (!slot) {
cerr << "[ERROR] Record::add(): Attempt to add NULL Slot." << endl;
return;
}
_slotList.push_back(slot);
}
} // End of Hurricane namespace.
// ****************************************************************************************************
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
// ****************************************************************************************************

View File

@ -30,7 +30,7 @@ Reference::Reference(Cell* cell, const Name& name, DbU::Unit x, DbU::Unit y)
_name(name),
_point(x,y)
{
if ( !_extend ) _extend = DbU::real(0.5);
if ( !_extend ) _extend = DbU::grid(0.5);
if (_name.isEmpty())
throw Error("Can't create " + _TName("Reference") + " : empty name");

View File

@ -2742,7 +2742,7 @@ Region& Region::Inflate(const DbU::Unit& quantity)
}
}
else if (quantity < 0) {
_growthToFit(getBoundingBox().inflate(DbU::real(1.0)));
_growthToFit(getBoundingBox().inflate(DbU::grid(1.0)));
list<Box> boxList;
for_each_object(Tile*, tile, Region_Tiles(this).getSubSet(Tile::getIsVoidFilter())) {
boxList.push_back(tile->getBoundingBox());
@ -3007,7 +3007,7 @@ Region::verticalEnhancement()
{
bool modif = false;
Region result;
double minSide = DbU::getReal(DbU::real(5.0));
double minSide = DbU::getGrid(DbU::grid(5.0));
double minArea = minSide*minSide;
do {
// Rechercher la box de plus grande surface
@ -3015,7 +3015,7 @@ Region::verticalEnhancement()
double area = minArea;
for_each_box (box, getBoxes()) {
if (! box.isEmpty()) {
double a = DbU::getReal(box.getWidth()) * DbU::getReal(box.getHeight());
double a = DbU::getGrid(box.getWidth()) * DbU::getGrid(box.getHeight());
if (area < a) {
area = a;
maxBox = box;
@ -3025,7 +3025,7 @@ Region::verticalEnhancement()
}
if (maxBox.isEmpty()) break;
Tile* tile = _getTileAt (maxBox.getCenter());
if (maxBox.getWidth() >= DbU::real(2.0)) {
if (maxBox.getWidth() >= DbU::grid(2.0)) {
modif = tile->VerticalEnhancement (this);
}
result.fill (tile->getBoundingBox());
@ -3054,7 +3054,7 @@ Region::horizontalEnhancement()
{
bool modif = false;
Region result;
const double minSide = DbU::getReal(DbU::real(5.0));
const double minSide = DbU::getGrid(DbU::grid(5.0));
double minArea = minSide*minSide;
do {
// Rechercher la box de plus grande surface
@ -3062,7 +3062,7 @@ Region::horizontalEnhancement()
double area = minArea;
for_each_box (box, getBoxes()) {
if (! box.isEmpty()) {
double a = DbU::getReal(box.getWidth()) * DbU::getReal(box.getHeight());
double a = DbU::getGrid(box.getWidth()) * DbU::getGrid(box.getHeight());
if (area < a) {
area = a;
maxBox = box;
@ -3072,7 +3072,7 @@ Region::horizontalEnhancement()
}
if (maxBox.isEmpty()) break;
Tile* tile = _getTileAt (maxBox.getCenter());
if (maxBox.getWidth() >= DbU::real(2.0)) {
if (maxBox.getWidth() >= DbU::grid(2.0)) {
modif = tile->HorizontalEnhancement (this);
}
result.fill (tile->getBoundingBox());

View File

@ -33,5 +33,24 @@
namespace Hurricane {
// -------------------------------------------------------------------
// Class : "Hurricane::Slot".
size_t Slot::_allocateds = 0;
size_t Slot::getAllocateds ()
{
return _allocateds;
}
Slot::~Slot ()
{
//cerr << "Slot::~Slot() - " << _name << ": " << hex << (void*)this << dec << endl;
_allocateds--;
}
} // End of Hurricane namespace.

View File

@ -50,8 +50,7 @@
# include <typeinfo>
#include "hurricane/Commons.h"
# include "hurricane/Commons.h"

View File

@ -209,6 +209,7 @@ 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;

View File

@ -236,9 +236,9 @@ Record* Transformation::_getRecord() const
// *********************************
{
Record* record = new Record(getString(this));
record->add(getSlot("X", &_tx));
record->add(getSlot("Y", &_ty));
record->add(getSlot("Orientation", _orientation));
record->add(DbU::getValueSlot("_tx",&_tx));
record->add(DbU::getValueSlot("_ty",&_ty));
record->add(getSlot("_orientation", &_orientation));
return record;
}
@ -276,7 +276,7 @@ string Transformation::Orientation::_getString() const
Record* Transformation::Orientation::_getRecord() const
// **********************************************
{
Record* record = new Record(getString(this));
Record* record = new Record(getString(this));
record->add(getSlot("Code", &_code));
return record;
}

View File

@ -133,46 +133,46 @@ namespace Hurricane {
void BasicLayer::setRealName ( const char* realName) { _realName = realName; }
} // End of Hurricane namespace.
// -------------------------------------------------------------------
// Class : "Proxy...<const BasicLayer::Material::Code*>".
template<>
inline string ProxyTypeName<BasicLayer::Material::Code> ( const BasicLayer::Material::Code* object )
{ return "<PointerSlotAdapter<BasicLayer::Material::Code>>"; }
// Inspector Support for : BasicLayer::Material::Code.
template<>
inline string ProxyString<BasicLayer::Material::Code> ( const BasicLayer::Material::Code* object )
inline std::string getString<const Hurricane::BasicLayer::Material::Code*>
( const Hurricane::BasicLayer::Material::Code* object )
{
switch ( *object ) {
case BasicLayer::Material::nWell: return "nWell";
case BasicLayer::Material::pWell: return "pWell";
case BasicLayer::Material::nImplant: return "nImplant";
case BasicLayer::Material::pImplant: return "pImplant";
case BasicLayer::Material::active: return "active";
case BasicLayer::Material::poly: return "poly";
case BasicLayer::Material::cut: return "cut";
case BasicLayer::Material::metal: return "metal";
case BasicLayer::Material::blockage: return "blockage";
case BasicLayer::Material::other: return "other";
case Hurricane::BasicLayer::Material::nWell: return "nWell";
case Hurricane::BasicLayer::Material::pWell: return "pWell";
case Hurricane::BasicLayer::Material::nImplant: return "nImplant";
case Hurricane::BasicLayer::Material::pImplant: return "pImplant";
case Hurricane::BasicLayer::Material::active: return "active";
case Hurricane::BasicLayer::Material::poly: return "poly";
case Hurricane::BasicLayer::Material::cut: return "cut";
case Hurricane::BasicLayer::Material::metal: return "metal";
case Hurricane::BasicLayer::Material::blockage: return "blockage";
case Hurricane::BasicLayer::Material::other: return "other";
}
return "abnormal";
}
template<>
inline Record* ProxyRecord<BasicLayer::Material::Code> ( const BasicLayer::Material::Code* object )
inline Hurricane::Record* getRecord<const Hurricane::BasicLayer::Material::Code*>
( const Hurricane::BasicLayer::Material::Code* object )
{
Record* record = new Record(getString(object));
Hurricane::Record* record = new Hurricane::Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::BasicLayer)
INSPECTOR_P_SUPPORT(Hurricane::BasicLayer);
INSPECTOR_P_SUPPORT(Hurricane::BasicLayer::Material);
IOSTREAM_POINTER_SUPPORT(Hurricane::BasicLayer::Material::Code);
# endif

View File

@ -120,7 +120,7 @@ class Box {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Box)
INSPECTOR_PV_SUPPORT(Hurricane::Box);
#endif // HURRICANE_BOX

View File

@ -286,7 +286,14 @@ class Cell : public Entity {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Cell)
INSPECTOR_P_SUPPORT(Hurricane::Cell);
INSPECTOR_P_SUPPORT(Hurricane::Cell::InstanceMap);
INSPECTOR_P_SUPPORT(Hurricane::Cell::SlaveInstanceSet);
INSPECTOR_P_SUPPORT(Hurricane::Cell::NetMap);
INSPECTOR_P_SUPPORT(Hurricane::Cell::PinMap);
INSPECTOR_P_SUPPORT(Hurricane::Cell::SliceMap);
INSPECTOR_P_SUPPORT(Hurricane::Cell::MarkerSet);
#endif // HURRICANE_CELL

View File

@ -23,8 +23,8 @@ template<class Type> class SubSetCollection;
// Collection declaration
// ****************************************************************************************************
template<class Type> class Collection : public NestedSlotAdapter {
// *************************************************************
template<class Type> class Collection {
// ************************************
// Constructors
// ************
@ -813,17 +813,29 @@ template<class Type> class SubSetCollection : public Collection<Type> {
_locator->progress();
template<typename T>
class IsNestedSlotAdapter<const Hurricane::GenericCollection<T> > {
public:
enum { True=1, False=0 };
};
} // End of Hurricane namespace.
template<typename Type> inline std::string getString ( Hurricane::Collection<Type>& collection )
{ return collection._getString(); }
template<typename Type> inline std::string getString ( Hurricane::Collection<Type>* collection )
{ return collection->_getString(); }
template<typename Type> inline std::string getString ( const Hurricane::Collection<Type>* collection )
{ return collection->_getString(); }
template<typename Type> inline Hurricane::Record* getRecord ( Hurricane::Collection<Type>& collection )
{ return collection._getRecord(); }
template<typename Type> inline Hurricane::Record* getRecord ( Hurricane::Collection<Type>* collection )
{ return collection->_getRecord(); }
template<typename Type> inline Hurricane::Record* getRecord ( const Hurricane::Collection<Type>* collection )
{ return collection->_getRecord(); }
#include "hurricane/MultisetCollection.h"
#include "hurricane/SetCollection.h"
#include "hurricane/MapCollection.h"

View File

@ -30,8 +30,8 @@
#define __HURRICANE_COMMONS__
#include <stdio.h>
#include <assert.h>
#include <cstdio>
#include <cassert>
#include <string>
#include <list>
@ -41,6 +41,7 @@
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
@ -49,19 +50,17 @@
// | Macros Definition |
// x-----------------------------------------------------------------x
using namespace std;
//using namespace std;
namespace Hurricane {
using namespace std;
// ---------------------------------------------------------------
// Forward Declarations.
class Slot;
class Record;
@ -102,60 +101,498 @@ namespace Hurricane {
inline string demangle ( const type_info& info ) { return demangle(info.name()); }
} // End of Hurricane namespace.
#include "hurricane/Record.h"
// x-----------------------------------------------------------------x
// | Generic Functions Definition |
// | Functions for Inspector Support |
// x-----------------------------------------------------------------x
// Note 1: Theses are specialized templates for "getString<>()" & "getRecord<>()".
// Note 2: we are outside the Hurricane namespace.
// Note 3: thoses templates manage all POD & STL types.
using namespace std;
// Forward declaration of "getSlot<>()" template.
template<typename Data> inline Hurricane::Slot* getSlot ( std::string& name, Data d );
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data d );
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data* d );
// -------------------------------------------------------------------
// Inspector Support for : "POD types".
// Default match.
template<typename Data> inline std::string getString ( Data data )
{ return "<Data Unsupported by Inspector>"; }
// "const *" flavors.
template<> inline std::string getString<const bool*> ( const bool* b )
{ return (*b)?"True":"False" ; }
template<> inline std::string getString<const char*> ( const char* c )
{ return c; }
template<> inline std::string getString<const int*> ( const int* i )
{ std::ostringstream os (""); os << *i; return os.str(); }
template<> inline std::string getString<const long*> ( const long* l )
{ std::ostringstream os (""); os << *l; return os.str(); }
template<> inline std::string getString<const unsigned int*> ( const unsigned int* u )
{ std::ostringstream os (""); os << *u; return os.str(); }
template<> inline std::string getString<const unsigned long*> ( const unsigned long* ul )
{ std::ostringstream os (""); os << *ul; return os.str(); }
template<> inline std::string getString<const unsigned long long*> ( const unsigned long long* ull )
{ std::ostringstream os (""); os << *ull; return os.str(); }
template<> inline std::string getString<const unsigned short int*> ( const unsigned short int* us )
{ std::ostringstream os (""); os << *us; return os.str(); }
template<> inline std::string getString<const float*> ( const float* f )
{ std::ostringstream os (""); os << *f; return os.str(); }
template<> inline std::string getString<const double*> ( const double* d )
{ std::ostringstream os; os << *d; return os.str(); }
template<> inline std::string getString<const void*> ( const void* p )
{ std::ostringstream os ("0x"); os << std::hex << p; return os.str(); }
template<> inline std::string getString<const std::string*> ( const std::string* s )
{ return *s; }
// "*" flavors.
template<> inline std::string getString<bool*> ( bool* b )
{ return (*b)?"True":"False" ; }
template<> inline std::string getString<char*> ( char* c )
{ return c; }
template<> inline std::string getString<int*> ( int* i )
{ std::ostringstream os (""); os << *i; return os.str(); }
template<> inline std::string getString<long*> ( long* l )
{ std::ostringstream os (""); os << *l; return os.str(); }
template<> inline std::string getString<unsigned int*> ( unsigned int* u )
{ std::ostringstream os (""); os << *u; return os.str(); }
template<> inline std::string getString<unsigned long*> ( unsigned long* ul )
{ std::ostringstream os (""); os << *ul; return os.str(); }
template<> inline std::string getString<unsigned long long*> ( unsigned long long* ull )
{ std::ostringstream os (""); os << *ull; return os.str(); }
template<> inline std::string getString<unsigned short int*> ( unsigned short int* us )
{ std::ostringstream os (""); os << *us; return os.str(); }
template<> inline std::string getString<float*> ( float* f )
{ std::ostringstream os (""); os << *f; return os.str(); }
template<> inline std::string getString<double*> ( double* d )
{ std::ostringstream os; os << *d; return os.str(); }
template<> inline std::string getString<void*> ( void* p )
{ std::ostringstream os ("0x"); os << std::hex << p; return os.str(); }
template<> inline std::string getString<std::string*> ( std::string* s )
{ return *s; }
// "by value" flavors.
template<> inline std::string getString<bool> ( bool b )
{ return (b)?"True":"False" ; }
template<> inline std::string getString<char> ( const char c )
{ return std::string(1,c); }
template<> inline std::string getString<int> ( int i )
{ std::ostringstream os (""); os << i; return os.str(); }
template<> inline std::string getString<long> ( long l )
{ std::ostringstream os (""); os << l; return os.str(); }
template<> inline std::string getString<unsigned int> ( unsigned int u )
{ std::ostringstream os (""); os << u; return os.str(); }
template<> inline std::string getString<unsigned long> ( unsigned long ul )
{ std::ostringstream os (""); os << ul; return os.str(); }
template<> inline std::string getString<unsigned long long> ( unsigned long long ull )
{ std::ostringstream os (""); os << ull; return os.str(); }
template<> inline std::string getString<unsigned short int> ( unsigned short int us )
{ std::ostringstream os (""); os << us; return os.str(); }
template<> inline std::string getString<float> ( float f )
{ std::ostringstream os (""); os << f; return os.str(); }
template<> inline std::string getString<double> ( double d )
{ std::ostringstream os; os << d; return os.str(); }
template<> inline std::string getString<std::string> ( std::string s )
{ return s; }
template<typename Data> inline Hurricane::Record* getRecord ( Data data )
{ return NULL; }
// -------------------------------------------------------------------
// Inspector Support for : "const std::vector<Element>*".
template<typename Element>
inline std::string getString ( const std::vector<Element>* v )
{
std::string name = "const std::vector<Element>:";
return name + getString<size_t>(v->size());
}
template<typename Element>
inline Hurricane::Record* getRecord ( const std::vector<Element>* v )
{
Hurricane::Record* record = NULL;
if ( !v->empty() ) {
record = new Hurricane::Record ( "const std::vector<Element>" );
unsigned n = 1;
typename std::vector<Element>::const_iterator iterator = v->begin();
while ( iterator != v->end() ) {
record->add ( getSlot<Element>(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "const std::list<Element>*".
template<typename Element>
inline std::string getString ( const std::list<Element>* l )
{
std::string name = "const std::list<Element>:";
return name + getString<size_t>(l->size());
}
template<typename Element>
inline Hurricane::Record* getRecord ( const std::list<Element>* l )
{
Hurricane::Record* record = NULL;
if ( !l->empty() ) {
record = new Hurricane::Record ( "const std::list<Element>" );
unsigned n = 1;
typename std::list<Element>::const_iterator iterator = l->begin();
while ( iterator != l->end() ) {
record->add ( getSlot<Element>(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
template<typename Element>
inline std::string getString ( std::list<Element>* l )
{
std::string name = "std::list<Element>:";
return name + getString<size_t>(l->size());
}
template<typename Element>
inline Hurricane::Record* getRecord ( std::list<Element>* l )
{
Hurricane::Record* record = NULL;
if ( !l->empty() ) {
record = new Hurricane::Record ( "std::list<Element>" );
unsigned n = 1;
typename std::list<Element>::iterator iterator = l->begin();
while ( iterator != l->end() ) {
record->add ( getSlot<Element>(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "[const] std::map<Key,Element,Compare>*.
template<typename Key, typename Element, typename Compare>
inline std::string getString ( const std::map<Key,Element,Compare>* m )
{
std::string name = "std::map<Element>:";
return name + getString<size_t>(m->size());
}
template<typename Key, typename Element, typename Compare>
inline Hurricane::Record* getRecord ( const std::map<Key,Element,Compare>* m )
{
Hurricane::Record* record = NULL;
if ( !m->empty() ) {
record = new Hurricane::Record ( "std::map<Element>" );
typename std::map<Key,Element,Compare>::const_iterator iterator = m->begin();
while ( iterator != m->end() ) {
record->add ( getSlot<Element>(getString(iterator->first), iterator->second) );
++iterator;
}
}
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "[const] std::multimap<Key,Element,Compare>*.
template<typename Key, typename Element, typename Compare>
inline std::string getString ( const std::multimap<Key,Element,Compare>* m )
{
std::string name = "std::multimap<Element>:";
return name + getString<size_t>(m->size());
}
template<typename Key, typename Element, typename Compare>
inline Hurricane::Record* getRecord ( const std::multimap<Key,Element,Compare>* m )
{
Hurricane::Record* record = NULL;
if ( !m->empty() ) {
record = new Hurricane::Record ( "std::multimap<Element>" );
typename std::multimap<Key,Element,Compare>::const_iterator iterator = m->begin();
while ( iterator != m->end() ) {
record->add ( getSlot<Element>(getString(iterator->first), iterator->second) );
++iterator;
}
}
return record;
}
template<typename Key, typename Element, typename Compare>
inline std::string getString ( std::multimap<Key,Element,Compare>* m )
{
std::string name = "std::multimap<Element>:";
return name + getString<size_t>(m->size());
}
template<typename Key, typename Element, typename Compare>
inline Hurricane::Record* getRecord ( std::multimap<Key,Element,Compare>* m )
{
Hurricane::Record* record = NULL;
if ( !m->empty() ) {
record = new Hurricane::Record ( "std::multimap<Element>" );
typename std::multimap<Key,Element,Compare>::iterator iterator = m->begin();
while ( iterator != m->end() ) {
record->add ( getSlot<Element>(getString(iterator->first), iterator->second) );
++iterator;
}
}
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;
}
template<typename Element, typename Compare>
inline std::string getString ( std::set<Element,Compare>* s )
{
std::string name = "std::set<Element>:";
return name + getString<size_t>(s->size());
}
template<typename Element, typename Compare>
inline Hurricane::Record* getRecord ( std::set<Element,Compare>* s )
{
Hurricane::Record* record = NULL;
if ( !s->empty() ) {
record = new Hurricane::Record ( "std::set<Element>" );
unsigned n = 1;
typename std::set<Element,Compare>::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>*".
template<typename Element, typename Compare>
inline std::string getString ( const std::multiset<Element,Compare>* s )
{
std::string name = "std::multiset<Element>:";
return name + getString<size_t>(s->size());
}
template<typename Element, typename Compare>
inline Hurricane::Record* getRecord ( const std::multiset<Element,Compare>* s )
{
Hurricane::Record* record = NULL;
if ( !s->empty() ) {
record = new Hurricane::Record ( "std::multiset<Element>" );
unsigned n = 1;
typename std::multiset<Element,Compare>::const_iterator iterator = s->begin();
while ( iterator != s->end() ) {
record->add ( getSlot<Element>(getString(n++), *iterator) );
++iterator;
}
}
return record;
}
# define IOSTREAM_POINTER_SUPPORT(Data) \
inline std::ostream& operator<< ( std::ostream& o, Data* d ) \
{ \
if (!d) return o << "NULL"; \
return o << "&" << getString<Data*>(d); \
} \
inline std::ostream& operator<< ( std::ostream& o, const Data* d ) \
{ \
if (!d) return o << "NULL"; \
return o << "&" << getString<const Data*>(d); \
}
# define INSPECTOR_POINTER_SUPPORT(Data) \
template<> inline std::string getString<Data*>( Data* data ) \
{ if (!data) return "NULL " #Data; return data->_getString(); } \
\
template<> inline std::string getString<const Data*>( const Data* data ) \
{ if (!data) return "NULL const " #Data; return data->_getString(); } \
\
template<> inline Hurricane::Record* getRecord<Data*>( Data* data ) \
{ if (!data) return NULL; return data->_getRecord(); } \
\
template<> inline Hurricane::Record* getRecord<const Data*>( const Data* data ) \
{ if (!data) return NULL; return data->_getRecord(); } \
# define IOSTREAM_REFERENCE_SUPPORT(Data) \
inline std::ostream& operator<< ( std::ostream& o, Data& d ) \
{ return o << getString<Data&>(d); } \
\
inline std::ostream& operator<< ( std::ostream& o, const Data& d ) \
{ return o << getString<Data&>(d); }
# define INSPECTOR_REFERENCE_SUPPORT(Data) \
template<> inline std::string getString<Data&>( Data& data ) \
{ return data._getString(); } \
\
template<> inline std::string getString<const Data&>( const Data& data ) \
{ return data._getString(); } \
\
template<> inline Hurricane::Record* getRecord<Data&>( Data& data ) \
{ return data._getRecord(); } \
\
template<> inline Hurricane::Record* getRecord<const Data&>( const Data& data ) \
{ return data._getRecord(); }
# define IOSTREAM_VALUE_SUPPORT(Data) \
inline std::ostream& operator<< ( std::ostream& o, Data d ) \
{ return o << getString<Data>(d); }
# define INSPECTOR_VALUE_SUPPORT(Data) \
template<> inline std::string getString<Data>( Data data ) \
{ return data._getString(); } \
\
template<> inline Hurricane::Record* getRecord<Data>( Data data ) \
{ return data._getRecord(); }
# define INSPECTOR_P_SUPPORT(Data) \
INSPECTOR_POINTER_SUPPORT(Data) \
IOSTREAM_POINTER_SUPPORT(Data)
# define INSPECTOR_R_SUPPORT(Data) \
INSPECTOR_REFERENCE_SUPPORT(Data) \
IOSTREAM_REFERENCE_SUPPORT(Data)
# define INSPECTOR_V_SUPPORT(Data) \
INSPECTOR_VALUE_SUPPORT(Data) \
IOSTREAM_VALUE_SUPPORT(Data)
# define INSPECTOR_PR_SUPPORT(Data) \
INSPECTOR_POINTER_SUPPORT(Data) \
INSPECTOR_REFERENCE_SUPPORT(Data) \
IOSTREAM_POINTER_SUPPORT(Data) \
IOSTREAM_REFERENCE_SUPPORT(Data)
# define INSPECTOR_PV_SUPPORT(Data) \
INSPECTOR_POINTER_SUPPORT(Data) \
INSPECTOR_VALUE_SUPPORT(Data) \
IOSTREAM_POINTER_SUPPORT(Data) \
IOSTREAM_VALUE_SUPPORT(Data)
// x-----------------------------------------------------------------x
// | getString() Overloads for POD/STL types |
// | Classes Neededs in All Hurricane Modules |
// x-----------------------------------------------------------------x
// Note: we are outside the Hurricane namespace.
#include "hurricane/SlotAdapter.h"
// x-----------------------------------------------------------------x
// | Scan() Overloads for POD/STL types |
// x-----------------------------------------------------------------x
// Note: we are outside the Hurricane namespace.
bool Scan ( const string& s, int& i );
bool Scan ( const string& s, unsigned& u );
bool Scan ( const string& s, unsigned short& u );
bool Scan ( const string& s, double& d );
bool Scan ( const string& s, string& pattern );
bool Scan ( const string& s, unsigned short& redValue
, unsigned short& greenValue
, unsigned short& blueValue );
// x-----------------------------------------------------------------x
// | Record & Tabulation Types Definitions |
// x-----------------------------------------------------------------x
// Note: Record & Tabulation are not templates, so they can be defined
// early.
#include "hurricane/Slot.h"
#include "hurricane/Tabulation.h"

View File

@ -119,8 +119,9 @@ double getArea ( Component* component );
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Component)
SetNestedSlotAdapter(Hurricane::Component::BodyHook)
INSPECTOR_P_SUPPORT(Hurricane::Component);
INSPECTOR_P_SUPPORT(Hurricane::Component::BodyHook);
#endif // HURRICANE_COMPONENT

View File

@ -114,9 +114,6 @@ class CompositeLayer : public Layer {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::CompositeLayer)
// ****************************************************************************************************
// Generic functions

View File

@ -138,7 +138,9 @@ class Contact : public Component {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Contact)
INSPECTOR_P_SUPPORT(Hurricane::Contact);
INSPECTOR_P_SUPPORT(Hurricane::Contact::AnchorHook);
#endif // HURRICANE_CONTACT

View File

@ -108,7 +108,4 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::ContactLayer)
# endif

View File

@ -19,8 +19,8 @@ namespace Hurricane {
// DBo declaration
// ****************************************************************************************************
class DBo : public NestedSlotAdapter {
// *********************************
class DBo {
// ********
#if !defined(__DOXYGEN_PROCESSOR__)
@ -97,8 +97,22 @@ class DBo : public NestedSlotAdapter {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::DBo)
PointerIOStreamSupport(Hurricane::DBo)
INSPECTOR_P_SUPPORT(Hurricane::DBo);
template<>
inline Hurricane::Slot* getSlot ( const std::string& name, const std::set<Hurricane::Property*>* s )
{
return new Hurricane::SlotTemplate<const std::set<Hurricane::Property*>*>(name,s);
}
template<>
inline Hurricane::Slot* getSlot ( const std::string& name, std::set<Hurricane::Property*>* s )
{
return new Hurricane::SlotTemplate<std::set<Hurricane::Property*>*>(name,s);
}
#endif // HURRICANE_DBO

View File

@ -73,7 +73,8 @@ class DataBase : public DBo {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::DataBase)
INSPECTOR_P_SUPPORT(Hurricane::DataBase);
#endif // HURRICANE_DATA_BASE

View File

@ -37,27 +37,39 @@ namespace Hurricane {
class DbU {
public:
enum UnitPower { Pico = 1
, Nano
, Micro
, Milli
, Unity
, Kilo
};
public:
typedef long Unit;
public:
enum StringMode { Db = 1
, Real = 2
, Grid = 2
, Symbolic = 4
};
public:
// User to DB Converters.
static inline Unit db ( long value );
static inline Unit real ( double value );
static inline Unit grid ( double value );
static inline Unit lambda ( double value );
// Precision & Resolution Managment.
static unsigned int getPrecision ();
static unsigned int getMaximalPrecision ();
static double getResolution ();
static void setPrecision ( unsigned int precision );
// Founder Grid Managment.
static double getUnitPower ( UnitPower p );
static void setPhysicalsPerGrid ( double gridsPerLambda, UnitPower p );
static double getPhysicalsPerGrid ();
// Lamba Managment.
static void setRealsPerLambda ( double realsPerLambda );
static double getRealsPerLambda ();
static void setGridsPerLambda ( double gridsPerLambda );
static double getGridsPerLambda ();
// Grid Managment.
//static void setGridStep ( const Unit& gridStep );
//static const Unit getGridStep ();
@ -65,9 +77,11 @@ namespace Hurricane {
//static bool isOnGrid ( const Unit& unit, int n=1 );
// Conversions.
static inline long getDb ( Unit u );
static inline double getReal ( Unit u );
static inline double getGrid ( Unit u );
static inline double getLambda ( Unit u );
static string getValueString ( Unit u );
static Record* getValueRecord ( const Unit* u );
static Slot* getValueSlot ( const string& name, const Unit* u );
static inline void setStringMode ( unsigned int mode );
public:
@ -79,18 +93,19 @@ namespace Hurricane {
static const unsigned int _maximalPrecision;
static unsigned int _precision;
static double _resolution;
static double _realsPerLambda;
static double _gridsPerLambda;
static double _physicalsPerGrid;
static unsigned int _stringMode;
};
// Inline Functions.
inline DbU::Unit DbU::db ( long value ) { return value; }
inline DbU::Unit DbU::real ( double value ) { return (long)rint( value/_resolution ); }
inline DbU::Unit DbU::lambda ( double value ) { return real(value*_realsPerLambda); }
inline DbU::Unit DbU::grid ( double value ) { return (long)rint( value/_resolution ); }
inline DbU::Unit DbU::lambda ( double value ) { return grid(value*_gridsPerLambda); }
inline long DbU::getDb ( DbU::Unit u ) { return u; }
inline double DbU::getReal ( DbU::Unit u ) { return _resolution*(double)u; }
inline double DbU::getLambda ( DbU::Unit u ) { return getReal(u)/_realsPerLambda; }
inline double DbU::getGrid ( DbU::Unit u ) { return _resolution*(double)u; }
inline double DbU::getLambda ( DbU::Unit u ) { return getGrid(u)/_gridsPerLambda; }
inline void DbU::setStringMode ( unsigned int mode ) { _stringMode = mode; }

View File

@ -109,7 +109,4 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::DiffusionLayer)
# endif

View File

@ -61,7 +61,8 @@ class Entity : public DBo {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Entity)
INSPECTOR_P_SUPPORT(Hurricane::Entity);
#endif // HURRICANE_ENTITY

View File

@ -63,7 +63,4 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Error)
# endif // __HURRICANE_ERROR__

View File

@ -17,8 +17,8 @@ namespace Hurricane {
// Exception declaration
// ****************************************************************************************************
class Exception : public NestedSlotAdapter {
// ***************************************
class Exception {
// **************
// Constructors
// ************
@ -53,9 +53,6 @@ class Exception : public NestedSlotAdapter {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Exception)
#endif // HURRICANE_EXCEPTION
// ****************************************************************************************************

View File

@ -20,7 +20,7 @@ template<class Type> class NotFilter;
// Filter declaration
// ****************************************************************************************************
template<class Type> class Filter : public NestedSlotAdapter {
template<class Type> class Filter {
// *********************************************************
// Constructors
@ -286,13 +286,6 @@ template<class Type> class NotFilter : public Filter<Type> {
// ****************************************************************************************************
template<typename T>
class IsNestedSlotAdapter<const Hurricane::GenericFilter<T> > {
public:
enum { True=1, False=0 };
};
} // End of Hurricane namespace.

View File

@ -84,7 +84,8 @@ class Go : public Entity {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Go)
INSPECTOR_P_SUPPORT(Hurricane::Go);
#endif // HURRICANE_GO

View File

@ -19,8 +19,8 @@ class Component;
// Hook declaration
// ****************************************************************************************************
class Hook : public NestedSlotAdapter {
// **********************************
class Hook {
// *********
// Attributes
// **********
@ -92,7 +92,8 @@ class Hook : public NestedSlotAdapter {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Hook)
INSPECTOR_P_SUPPORT(Hurricane::Hook);
#endif // HURRICANE_HOOK

View File

@ -101,7 +101,8 @@ class Horizontal : public Segment {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Horizontal)
INSPECTOR_P_SUPPORT(Hurricane::Horizontal);
#endif // HURRICANE_HORIZONTAL

View File

@ -71,7 +71,7 @@ bool IsHyperNetRootNetOccurrence(Occurrence netoccurrence);
} // End of Hurricane namespace.
PointerIOStreamSupport(Hurricane::HyperNet)
INSPECTOR_P_SUPPORT(Hurricane::HyperNet);

View File

@ -172,42 +172,41 @@ class Instance : public Go {
};
// -------------------------------------------------------------------
// Class : "Proxy...<const Instance::PlacementStatus::Code*>".
template<>
inline string ProxyTypeName<Instance::PlacementStatus::Code>
( const Instance::PlacementStatus::Code* object )
{ return "<PointerSlotAdapter<Instance::PlacementStatus::Code>>"; }
template<>
inline string ProxyString <Instance::PlacementStatus::Code>
( const Instance::PlacementStatus::Code* object )
{
switch ( *object ) {
case Instance::PlacementStatus::UNPLACED: return "PLACED";
case Instance::PlacementStatus::PLACED: return "PLACED";
case Instance::PlacementStatus::FIXED: return "FIXED";
}
return "ABNORMAL";
}
template<>
inline Record* ProxyRecord <Instance::PlacementStatus::Code>
( const Instance::PlacementStatus::Code* object )
{
Record* record = new Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Instance)
// -------------------------------------------------------------------
// Inspector Support for : Instance::PlacementStatus::Code*".
template<>
inline std::string getString<const Hurricane::Instance::PlacementStatus::Code*>
( const Hurricane::Instance::PlacementStatus::Code* object )
{
switch ( *object ) {
case Hurricane::Instance::PlacementStatus::UNPLACED: return "PLACED";
case Hurricane::Instance::PlacementStatus::PLACED: return "PLACED";
case Hurricane::Instance::PlacementStatus::FIXED: return "FIXED";
}
return "ABNORMAL";
}
template<>
inline Hurricane::Record* getRecord<const Hurricane::Instance::PlacementStatus::Code*>
( const Hurricane::Instance::PlacementStatus::Code* object )
{
Hurricane::Record* record = new Hurricane::Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
INSPECTOR_P_SUPPORT(Hurricane::Instance);
INSPECTOR_P_SUPPORT(Hurricane::Instance::PlacementStatus);
INSPECTOR_P_SUPPORT(Hurricane::Instance::PlugMap);
INSPECTOR_P_SUPPORT(Hurricane::Instance::SharedPathMap);
IOSTREAM_POINTER_SUPPORT(Hurricane::Instance::PlacementStatus::Code);
IOSTREAM_VALUE_SUPPORT(Hurricane::Instance::PlacementStatus::Code);
#endif // HURRICANE_INSTANCE

View File

@ -61,9 +61,6 @@ class Interruption : public Exception {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Interruption)
#endif // HURRICANE_INTERRUPTION
// ****************************************************************************************************

View File

@ -93,7 +93,7 @@ class Interval {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Interval)
INSPECTOR_PV_SUPPORT(Hurricane::Interval);
#endif // HURRICANE_INTERVAL

View File

@ -325,14 +325,10 @@ template<class Key, class Element> class IntrusiveMap {
record = new Record(getString(this));
unsigned n = 1;
for (unsigned index = 0; index < _length; index++) {
/**/
n = 1;
/**/
Element* element = _array[index];
while (element) {
// record->add(getSlot(getString(n++), element));
record->add(getSlot(getString(index) + ":" + getString(n++), element));
/**/
record->add(getSlot(getString(index) + ":" + getString(n++), element));
element = _getNextElement(element);
}
}
@ -442,6 +438,24 @@ template<class Key, class Element> class IntrusiveMap {
} // End of Hurricane namespace.
template<typename Key, typename Element>
inline std::string getString ( Hurricane::IntrusiveMap<Key,Element>* intrusiveMap )
{ return intrusiveMap->_getString(); }
template<typename Key, typename Element>
inline std::string getString ( const Hurricane::IntrusiveMap<Key,Element>* intrusiveMap )
{ return intrusiveMap->_getString(); }
template<typename Key, typename Element>
inline Hurricane::Record* getRecord ( Hurricane::IntrusiveMap<Key,Element>* intrusiveMap )
{ return intrusiveMap->_getRecord(); }
template<typename Key, typename Element>
inline Hurricane::Record* getRecord ( const Hurricane::IntrusiveMap<Key,Element>* intrusiveMap )
{ return intrusiveMap->_getRecord(); }
#endif // HURRICANE_INTRUSIVE_MAP
// ****************************************************************************************************

View File

@ -20,8 +20,8 @@ namespace Hurricane {
// IntrusiveSet declaration
// ****************************************************************************************************
template<class Element> class IntrusiveSet : public NestedSlotAdapter {
// ******************************************************************
template<class Element> class IntrusiveSet {
// *****************************************
// Types
// *****
@ -326,14 +326,10 @@ template<class Element> class IntrusiveSet : public NestedSlotAdapter {
record = new Record(getString(this));
unsigned n = 1;
for (unsigned index = 0; index < _length; index++) {
/**/
n = 1;
/**/
Element* element = _array[index];
while (element) {
// record->add(getSlot(getString(n++), element));
record->add(getSlot(getString(index) + ":" + getString(n++), element));
/**/
record->add(getSlot(getString(index) + ":" + getString(n++), element));
element = _getNextElement(element);
}
}
@ -463,6 +459,16 @@ template<class Element> class IntrusiveSet : public NestedSlotAdapter {
} // End of Hurricane namespace.
template<typename Type>
inline std::string getString ( Hurricane::IntrusiveSet<Type>& intrusiveSet )
{ return intrusiveSet._getString(); }
template<typename Type>
inline Hurricane::Record* getRecord ( Hurricane::IntrusiveSet<Type>& intrusiveSet )
{ return intrusiveSet._getRecord(); }
#endif // HURRICANE_INTRUSIVE_SET
// ****************************************************************************************************

View File

@ -45,16 +45,16 @@ namespace Hurricane {
// Types.
typedef unsigned long long Mask;
// Accessors.
inline Technology* getTechnology () const;
inline const Name& getName () const;
inline const Mask& getMask () const;
inline const Mask& getExtractMask () const;
inline Technology* getTechnology () const;
inline const Name& getName () const;
inline const Mask& getMask () const;
inline const Mask& getExtractMask () const;
inline const DbU::Unit& getMinimalSize () const;
inline const DbU::Unit& getMinimalSpacing () const;
inline DbU::Unit getPitch () const;
virtual BasicLayers getBasicLayers () const = 0;
virtual Layer* getConnectorLayer () const;
virtual Layer* getObstructionLayer () const;
virtual BasicLayers getBasicLayers () const = 0;
virtual Layer* getConnectorLayer () const;
virtual Layer* getObstructionLayer () const;
virtual DbU::Unit getEnclosure () const;
virtual DbU::Unit getExtentionCap () const;
virtual DbU::Unit getExtentionWidth () const;
@ -62,46 +62,46 @@ namespace Hurricane {
virtual DbU::Unit getExtentionCap ( const BasicLayer* layer ) const;
virtual DbU::Unit getExtentionWidth ( const BasicLayer* layer ) const;
// Predicates
bool contains ( const Layer* layer ) const;
bool intersect ( const Layer* layer ) const;
bool contains ( const Layer* layer ) const;
bool intersect ( const Layer* layer ) const;
// Updators
void setName ( const Name& name );
void setMinimalSize ( const DbU::Unit& minimalSize );
void setMinimalSpacing ( const DbU::Unit& minimalSpacing );
void setPitch ( const DbU::Unit& pitch );
virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit );
virtual void setExtentionCap ( const BasicLayer* layer, DbU::Unit );
virtual void setExtentionWidth ( const BasicLayer* layer, DbU::Unit );
void setName ( const Name& name );
void setMinimalSize ( const DbU::Unit& minimalSize );
void setMinimalSpacing ( const DbU::Unit& minimalSpacing );
void setPitch ( const DbU::Unit& pitch );
virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit );
virtual void setExtentionCap ( const BasicLayer* layer, DbU::Unit );
virtual void setExtentionWidth ( const BasicLayer* layer, DbU::Unit );
// Hurricane Managment.
virtual string _getString () const;
virtual Record* _getRecord () const;
inline Layer* _getNextOfTechnologyLayerMap () const;
inline void _setMask ( const Mask& mask );
inline void _setExtractMask ( const Mask& extractMask );
inline void _setNextOfTechnologyLayerMap ( Layer* layer );
virtual string _getString () const;
virtual Record* _getRecord () const;
inline Layer* _getNextOfTechnologyLayerMap () const;
inline void _setMask ( const Mask& mask );
inline void _setExtractMask ( const Mask& extractMask );
inline void _setNextOfTechnologyLayerMap ( Layer* layer );
private:
// Internal: Attributes
Technology* _technology;
Name _name;
Mask _mask;
Mask _extractMask;
Technology* _technology;
Name _name;
Mask _mask;
Mask _extractMask;
DbU::Unit _minimalSize;
DbU::Unit _minimalSpacing;
DbU::Unit _pitch;
Layer* _nextOfTechnologyLayerMap;
Layer* _nextOfTechnologyLayerMap;
protected:
// Internal: Constructors & Destructors.
Layer ( Technology* technology
, const Name& name
, const DbU::Unit& minimalSize = 0
, const DbU::Unit& minimalSpacing = 0
, const DbU::Unit& pitch = 0
);
virtual void _postCreate ();
virtual void _preDestroy ();
Layer ( Technology* technology
, const Name& name
, const DbU::Unit& minimalSize = 0
, const DbU::Unit& minimalSpacing = 0
, const DbU::Unit& pitch = 0
);
virtual void _postCreate ();
virtual void _preDestroy ();
};
@ -110,9 +110,9 @@ namespace Hurricane {
inline const Name& Layer::getName () const { return _name; }
inline const Layer::Mask& Layer::getMask () const { return _mask; }
inline const Layer::Mask& Layer::getExtractMask () const { return _extractMask; }
inline const DbU::Unit& Layer::getMinimalSize () const { return _minimalSize; }
inline const DbU::Unit& Layer::getMinimalSpacing () const { return _minimalSpacing; }
inline DbU::Unit Layer::getPitch () const { return (!_pitch?(_minimalSize + _minimalSpacing):_pitch); }
inline const DbU::Unit& Layer::getMinimalSize () const { return _minimalSize; }
inline const DbU::Unit& Layer::getMinimalSpacing () const { return _minimalSpacing; }
inline DbU::Unit Layer::getPitch () const { return (!_pitch?(_minimalSize + _minimalSpacing):_pitch); }
inline Layer* Layer::_getNextOfTechnologyLayerMap () const { return _nextOfTechnologyLayerMap; }
inline void Layer::_setMask ( const Mask& mask ) { _mask = mask; }
inline void Layer::_setExtractMask ( const Mask& extractMask ) { _extractMask = extractMask; }
@ -123,7 +123,7 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Layer)
INSPECTOR_P_SUPPORT(Hurricane::Layer);
# endif

View File

@ -114,7 +114,9 @@ class Library : public DBo {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Library)
INSPECTOR_P_SUPPORT(Hurricane::Library);
INSPECTOR_P_SUPPORT(Hurricane::Library::LibraryMap);
INSPECTOR_P_SUPPORT(Hurricane::Library::CellMap);
#endif // HURRICANE_LIBRARY

View File

@ -18,8 +18,8 @@ namespace Hurricane {
// Locator declaration
// ****************************************************************************************************
template<class Type> class Locator : public NestedSlotAdapter {
// **********************************************************
template<class Type> class Locator {
// *********************************
// Constructors
// ************
@ -249,14 +249,6 @@ template<class Type> class GenericLocator : public Locator<Type> {
// ****************************************************************************************************
template<typename T>
class IsNestedSlotAdapter<const Hurricane::GenericLocator<T> > {
public:
enum { True=1, False=0 };
};
} // End of Hurricane namespace.

View File

@ -163,7 +163,7 @@ template<class Key, class Element, class Compare = less<Key> >
record = new Record(_GetString());
typename map<Key, Element, Compare>::const_iterator iterator = _elementMap->begin(); // AD
while (iterator != _elementMap->end()) {
record->add(GetSlot(GetString((*iterator).first), (*iterator).second));
record->add(getSlot<Element>(GetString((*iterator).first), (*iterator).second));
++iterator;
}
}

View File

@ -9,10 +9,6 @@
#include "hurricane/Commons.h"
#include "hurricane/Tabulation.h"
#include "hurricane/Record.h"
#include "hurricane/Slot.h"
namespace Hurricane {

View File

@ -76,11 +76,9 @@ class Name {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Name)
INSPECTOR_PV_SUPPORT(Hurricane::Name);
bool Scan ( const string& s, Hurricane::Name& name );
#endif // HURRICANE_NAME
// ****************************************************************************************************

View File

@ -219,76 +219,70 @@ class Net : public Entity {
// -------------------------------------------------------------------
// Class : "Proxy...<const Net::Type::Code*>".
template<>
inline string ProxyTypeName<Net::Type::Code>
( const Net::Type::Code* object )
{ return "<PointerSlotAdapter<Net::Type::Code>>"; }
template<>
inline string ProxyString <Net::Type::Code>
( const Net::Type::Code* object )
{
switch ( *object ) {
case Net::Type::UNDEFINED: return "UNDEFINED";
case Net::Type::LOGICAL: return "LOGICAL";
case Net::Type::CLOCK: return "CLOCK";
case Net::Type::POWER: return "POWER";
case Net::Type::GROUND: return "GROUND";
}
return "ABNORMAL";
}
template<>
inline Record* ProxyRecord <Net::Type::Code>
( const Net::Type::Code* object )
{
Record* record = new Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
// -------------------------------------------------------------------
// Class : "Proxy...<const Net::Direction::Code*>".
template<>
inline string ProxyTypeName<Net::Direction::Code>
( const Net::Direction::Code* object )
{ return "<PointerSlotAdapter<Net::Direction::Code>>"; }
template<>
inline string ProxyString <Net::Direction::Code>
( const Net::Direction::Code* object )
{
switch ( *object ) {
case Net::Direction::UNDEFINED: return "UNDEFINED";
case Net::Direction::IN: return "IN";
case Net::Direction::OUT: return "OUT";
case Net::Direction::INOUT: return "INOUT";
case Net::Direction::TRISTATE: return "TRISTATE";
}
return "ABNORMAL";
}
template<>
inline Record* ProxyRecord <Net::Direction::Code>
( const Net::Direction::Code* object )
{
Record* record = new Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Net)
// -------------------------------------------------------------------
// Inspector Support for : Net::Type::Code*".
template<>
inline std::string getString<const Hurricane::Net::Type::Code*>
( const Hurricane::Net::Type::Code* object )
{
switch ( *object ) {
case Hurricane::Net::Type::UNDEFINED: return "UNDEFINED";
case Hurricane::Net::Type::LOGICAL: return "LOGICAL";
case Hurricane::Net::Type::CLOCK: return "CLOCK";
case Hurricane::Net::Type::POWER: return "POWER";
case Hurricane::Net::Type::GROUND: return "GROUND";
}
return "ABNORMAL";
}
template<>
inline Hurricane::Record* getRecord<const Hurricane::Net::Type::Code*>
( const Hurricane::Net::Type::Code* object )
{
Hurricane::Record* record = new Hurricane::Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
// -------------------------------------------------------------------
// Inspector Support for : "const Net::Direction::Code*".
template<>
inline std::string getString<const Hurricane::Net::Direction::Code*>
( const Hurricane::Net::Direction::Code* object )
{
switch ( *object ) {
case Hurricane::Net::Direction::UNDEFINED: return "UNDEFINED";
case Hurricane::Net::Direction::IN: return "IN";
case Hurricane::Net::Direction::OUT: return "OUT";
case Hurricane::Net::Direction::INOUT: return "INOUT";
case Hurricane::Net::Direction::TRISTATE: return "TRISTATE";
}
return "ABNORMAL";
}
template<>
inline Hurricane::Record* getRecord<const Hurricane::Net::Direction::Code*>
( const Hurricane::Net::Direction::Code* object )
{
Hurricane::Record* record = new Hurricane::Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
INSPECTOR_P_SUPPORT(Hurricane::Net);
INSPECTOR_P_SUPPORT(Hurricane::Net::ComponentSet);
INSPECTOR_P_SUPPORT(Hurricane::Net::RubberSet);
INSPECTOR_P_SUPPORT(Hurricane::Net::Type);
INSPECTOR_P_SUPPORT(Hurricane::Net::Direction);
#endif // HURRICANE_NET

View File

@ -92,7 +92,7 @@ class Occurrence {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Occurrence)
INSPECTOR_PV_SUPPORT(Hurricane::Occurrence);
#endif // HURRICANE_OCCURENCE

View File

@ -69,7 +69,8 @@ class Pad : public Component {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Pad)
INSPECTOR_P_SUPPORT(Hurricane::Pad);
#endif // HURRICANE_PAD

View File

@ -97,7 +97,7 @@ class Path {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Path)
INSPECTOR_PV_SUPPORT(Hurricane::Path);
#endif // HURRICANE_PATH

View File

@ -146,6 +146,4 @@ class Pin : public Contact {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Pin)
#endif // HURRICANE_PIN

View File

@ -104,7 +104,8 @@ class Plug : public Component {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Plug)
INSPECTOR_P_SUPPORT(Hurricane::Plug);
#endif // HURRICANE_PLUG

View File

@ -78,7 +78,7 @@ class Point {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Point)
INSPECTOR_PV_SUPPORT(Hurricane::Point);
#endif // HURRICANE_POINT

View File

@ -20,8 +20,8 @@ namespace Hurricane {
// Property declaration
// ****************************************************************************************************
class Property : public NestedSlotAdapter {
// **************************************
class Property {
// *************
// Constructors
// ************
@ -352,22 +352,12 @@ template<class Value> class StandardSharedProperty : public SharedProperty {
};
template<typename T>
class IsNestedSlotAdapter<StandardPrivateProperty<T> > {
public:
enum { True=1, False=0 };
};
template<typename T>
class IsNestedSlotAdapter<StandardSharedProperty<T> > {
public:
enum { True=1, False=0 };
};
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::Property);
#endif // HURRICANE_PROPERTY
// ****************************************************************************************************

View File

@ -111,6 +111,11 @@ class QuadTree {
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::QuadTree);
INSPECTOR_P_SUPPORT(Hurricane::QuadTree::GoSet);
#endif // HURRICANE_QUAD_TREE
// ****************************************************************************************************

View File

@ -64,7 +64,8 @@ class Quark : public DBo {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Quark)
INSPECTOR_P_SUPPORT(Hurricane::Quark);
#endif // HURRICANE_QUARK

View File

@ -26,8 +26,8 @@
#ifndef __RECORD__
#define __RECORD__
#ifndef __HURRICANE_RECORD__
#define __HURRICANE_RECORD__
#ifndef __HURRICANE_COMMONS__
@ -38,57 +38,45 @@
namespace Hurricane {
// -------------------------------------------------------------------
// Forward Declarations.
class Slot;
// -------------------------------------------------------------------
// Class : "Record".
class Record {
public:
// Types.
typedef list<Slot*> SlotList;
public:
typedef list<Slot*> SlotList;
// Constructor & Destructor.
Record ( const string& name );
virtual ~Record ();
// Methods.
static size_t getAllocateds ();
inline const string& getName () const;
Slot* getSlot ( unsigned no ) const;
void add ( Slot* slot );
inline SlotList& _getSlotList ();
// Attributes
private:
string _name;
SlotList _slotList;
// Internal: Static Attributes.
static size_t _allocateds;
// Internal: Attributes
string _name;
SlotList _slotList;
// Constructors
public:
Record ( const string& name );
private:
Record ( const Record& record );
Record& operator= ( const Record& record );
// Destructor
public:
virtual ~Record();
// Accessors
public:
const string& getName () const { return _name; };
Slot* getSlot ( unsigned no ) const;
// Updators
public:
void add ( Slot* slot );
// Others
public:
string _getTypeName () const { return _TName("Record"); };
string _getString () const;
SlotList& _getSlotList () { return _slotList; };
// Forbidden: Constructors
Record ( const Record& record );
Record& operator= ( const Record& record );
};
// Inline Functions.
inline const string& Record::getName () const { return _name; }
inline Record::SlotList& Record::_getSlotList () { return _slotList; }
} // End of Hurricane namespace.

View File

@ -110,7 +110,4 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::RegularLayer)
# endif

View File

@ -101,9 +101,6 @@ class StandardRelation : public Relation {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Relation)
SetNestedSlotAdapter(Hurricane::StandardRelation)
#endif // HURRICANE_RELATION
// ****************************************************************************************************

View File

@ -96,7 +96,8 @@ class Rubber : public Go {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Rubber)
INSPECTOR_P_SUPPORT(Hurricane::Rubber);
#endif // HURRICANE_RUBBER

View File

@ -123,9 +123,10 @@ class Segment : public Component {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Segment)
SetNestedSlotAdapter(Hurricane::Segment::SourceHook)
SetNestedSlotAdapter(Hurricane::Segment::TargetHook)
INSPECTOR_P_SUPPORT(Hurricane::Segment);
INSPECTOR_P_SUPPORT(Hurricane::Segment::SourceHook);
INSPECTOR_P_SUPPORT(Hurricane::Segment::TargetHook);
#endif // HURRICANE_SEGMENT

View File

@ -10,8 +10,6 @@
#include "hurricane/Commons.h"
#include "hurricane/Tabulation.h"
#include "hurricane/Record.h"
#include "hurricane/Slot.h"
namespace Hurricane {

View File

@ -84,6 +84,9 @@ class SharedName {
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::SharedName);
#endif // HURRICANE_SHARED_NAME
// ****************************************************************************************************

View File

@ -112,6 +112,9 @@ class SharedPath {
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::SharedPath);
#endif // HURRICANE_SHARED_PATH

View File

@ -90,6 +90,10 @@ class Slice {
} // End of Hurricane namespace.
INSPECTOR_P_SUPPORT(Hurricane::Slice);
#endif // HURRICANE_SLICE
// ****************************************************************************************************

View File

@ -6,7 +6,7 @@
//
// ===================================================================
//
// $Id: Slot.h,v 1.9 2007/07/29 15:25:00 jpc Exp $
// $Id$
//
// x-----------------------------------------------------------------x
// | |
@ -42,109 +42,200 @@ namespace Hurricane {
// -------------------------------------------------------------------
// Class : "Slot".
class Slot : public NestedSlotAdapter {
// Attributes
protected:
const string _name;
const SlotAdapter* _data;
class Slot {
// Constructors
protected:
Slot ( const string& name, const SlotAdapter* data ) : _name(name), _data(data) {};
private:
Slot ( const Slot& slot ); // Not implemented to forbid copy.
// Destructor
public:
virtual ~Slot () {};
// Operators
private:
Slot& operator= ( const Slot& slot ); // Not implemented to forbid assignment.
// Accessors
public:
const string& getName () const { return _name; };
virtual string getDataString () const { return _data->_getString(); };
virtual Record* getDataRecord () const { return _data->_getRecord(); };
// Inspector Managment.
public:
virtual string _getString () const
{
return "<" + _getTypeName()
+ " " + getName() + " "
+ _data->_getString() + ">";
};
};
// -------------------------------------------------------------------
// Class : "PointerSlot".
//
// The SlotAdapter is not duplicated, it is for objects in which
// it's directly integrated (inheritance). This is used for Hurricane
// objects with virtual functions.
//
// This is default behavior of Slot, so PointerSlot doesn't change
// it, but it's more clear for developpers.
class PointerSlot : public Slot {
// Constructors
public:
PointerSlot ( const string& name, const SlotAdapter* data ) : Slot(name,data) {};
// Destructor.
public:
virtual ~PointerSlot () {};
virtual ~Slot ();
// Accessors.
static size_t getAllocateds ();
const string& getName () const;
virtual string getDataString () const = 0;
virtual Record* getDataRecord () const = 0;
virtual Slot* getClone () const = 0;
// Accessors
public:
virtual string _getTypeName () const { return _TName("PointerSlot"); };
protected:
// Internal: Static Attributes.
static size_t _allocateds;
// Internal: Attributes.
const string _name;
protected:
// Internal: Constructors & Destructors.
Slot ( const string& name );
};
// Inline Member Functions.
inline Slot::Slot ( const string& name ) : _name(name)
{
_allocateds++;
//cerr << "Slot::Slot() - " << _name << " " << hex << (void*)this << endl;
}
inline const string& Slot::getName () const { return _name; }
// -------------------------------------------------------------------
// Class : "ValueSlot".
//
// The SlotAdapter is duplicated. It's for objects coming from
// external libraries or that do not have virtual functions (like
// Points or Boxes).
// Class : "SlotTemplate".
class ValueSlot : public Slot {
template<typename Data>
class SlotTemplate : public Slot {
// Constructors
public:
ValueSlot (const string& name, const SlotAdapter* data ) : Slot(name,data) {};
// Constructor.
SlotTemplate ( const string& name, const Data data );
SlotTemplate ( string& name, const Data data );
// Accessors.
virtual string getDataString () const;
virtual Record* getDataRecord () const;
virtual SlotTemplate<Data>*
getClone () const;
// Destructor.
public:
virtual ~ValueSlot () { delete _data; };
// Accessors
public:
virtual string _getTypeName () const { return _TName("ValueSlot"); };
protected:
// Internal: Attributes.
const Data _data;
private:
// Internal: Constructors.
SlotTemplate ( const SlotTemplate& );
SlotTemplate& operator= ( const SlotTemplate& );
};
// Inline Member Functions.
template<typename Data>
SlotTemplate<Data>::SlotTemplate ( const string& name, const Data data )
: Slot(name), _data(data) { }
template<typename Data>
SlotTemplate<Data>::SlotTemplate ( string& name, const Data data )
: Slot(name), _data(data) { }
template<typename Data>
string SlotTemplate<Data>::getDataString () const { return getString(_data); }
template<typename Data>
Record* SlotTemplate<Data>::getDataRecord () const { return getRecord(_data); }
template<typename Data>
SlotTemplate<Data>* SlotTemplate<Data>::getClone () const
{ return new SlotTemplate(_name,_data); }
// -------------------------------------------------------------------
// Class : "SlotTemplate".
template<typename Data>
class SlotTemplate<Data*> : public Slot {
public:
// Constructor.
SlotTemplate ( const string& name, Data* data );
SlotTemplate ( string& name, Data* data );
// Accessors.
virtual string getDataString () const;
virtual Record* getDataRecord () const;
virtual SlotTemplate<Data*>*
getClone () const;
protected:
// Internal: Attributes.
Data* _data;
private:
// Internal: Constructors.
SlotTemplate ( const SlotTemplate& );
SlotTemplate& operator= ( const SlotTemplate& );
};
// Inline Member Functions.
template<typename Data>
SlotTemplate<Data*>::SlotTemplate ( const string& name, Data* data )
: Slot(name), _data(data) {}
template<typename Data>
SlotTemplate<Data*>::SlotTemplate ( string& name, Data* data )
: Slot(name), _data(data) {}
template<typename Data>
string SlotTemplate<Data*>::getDataString () const { return getString(_data); }
template<typename Data>
Record* SlotTemplate<Data*>::getDataRecord () const { return getRecord(_data); }
template<typename Data>
SlotTemplate<Data*>* SlotTemplate<Data*>::getClone () const
{ return new SlotTemplate(_name,_data); }
// -------------------------------------------------------------------
// Class : "SlotTemplate".
template<>
class SlotTemplate<Record*> : public Slot {
public:
// Constructor.
inline SlotTemplate ( const string& name, Record* data );
inline SlotTemplate ( string& name, Record* data );
// Accessors.
inline virtual string getDataString () const;
inline virtual Record* getDataRecord () const;
inline virtual SlotTemplate<Record*>*
getClone () const;
protected:
// Internal: Attributes.
Record* _data;
private:
// Internal: Constructors.
SlotTemplate ( const SlotTemplate& );
SlotTemplate& operator= ( const SlotTemplate& );
};
// Inline Member Functions.
inline SlotTemplate<Record*>::SlotTemplate ( const string& name, Record* data )
: Slot(name), _data(data) {}
inline SlotTemplate<Record*>::SlotTemplate ( string& name, Record* data )
: Slot(name), _data(data) {}
inline string SlotTemplate<Record*>::getDataString () const { return _name; }
inline Record* SlotTemplate<Record*>::getDataRecord () const { return _data; }
inline SlotTemplate<Record*>* SlotTemplate<Record*>::getClone () const
{ return new SlotTemplate<Record*>(_name,_data); }
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Slot)
SetNestedSlotAdapter(Hurricane::PointerSlot)
SetNestedSlotAdapter(Hurricane::ValueSlot)
template<typename Data>
inline Hurricane::Slot* getSlot( std::string& name, Data d )
{
return new Hurricane::SlotTemplate<Data> ( name, d );
}
template<typename Data>
inline Hurricane::Slot* getSlot( const std::string& name, Data d )
{
return new Hurricane::SlotTemplate<Data> ( name, d );
}
template<typename Data>
inline Hurricane::Slot* getSlot( const std::string& name, Data* d )
{
return new Hurricane::SlotTemplate<Data*> ( name, d );
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,10 @@
#include "hurricane/Commons.h"
#ifndef __HURRICANE_SLOT__
#error "Tabulation.h must be included after Commons.h"
#endif
namespace Hurricane {
@ -71,7 +75,8 @@ extern Tabulation tab;
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Tabulation)
INSPECTOR_PV_SUPPORT(Hurricane::Tabulation);
// ****************************************************************************************************

View File

@ -105,7 +105,8 @@ class Technology : public DBo {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Technology)
INSPECTOR_P_SUPPORT(Hurricane::Technology);
#endif // HURRICANE_TECHNOLOGY

View File

@ -51,7 +51,7 @@ class Timer {
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Timer)
INSPECTOR_PV_SUPPORT(Hurricane::Timer);
#endif // HURRICANE_TIMER

View File

@ -127,47 +127,70 @@ class Transformation {
// -------------------------------------------------------------------
// Class : "Proxy...<const Transformation::Orientation::Code*>".
template<>
inline string ProxyTypeName<Transformation::Orientation::Code>
( const Transformation::Orientation::Code* object )
{ return "<PointerSlotAdapter<Transformation::Orientation::Code>>"; }
template<>
inline string ProxyString <Transformation::Orientation::Code>
( const Transformation::Orientation::Code* object )
{
switch ( *object ) {
case Transformation::Orientation::ID: return "ID";
case Transformation::Orientation::R1: return "R1";
case Transformation::Orientation::R2: return "R2";
case Transformation::Orientation::R3: return "R3";
case Transformation::Orientation::MX: return "MX";
case Transformation::Orientation::XR: return "XR";
case Transformation::Orientation::MY: return "MY";
case Transformation::Orientation::YR: return "YR";
}
return "ABNORMAL";
}
template<>
inline Record* ProxyRecord <Transformation::Orientation::Code>
( const Transformation::Orientation::Code* object )
{
Record* record = new Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
} // End of Hurricane namespace.
ValueIOStreamSupport(Hurricane::Transformation)
// -------------------------------------------------------------------
// Inspector Support for : "Transformation::Orientation::Code*".
template<>
inline std::string getString<const Hurricane::Transformation::Orientation::Code*>
( const Hurricane::Transformation::Orientation::Code* object )
{
switch ( *object ) {
case Hurricane::Transformation::Orientation::ID: return "ID";
case Hurricane::Transformation::Orientation::R1: return "R1";
case Hurricane::Transformation::Orientation::R2: return "R2";
case Hurricane::Transformation::Orientation::R3: return "R3";
case Hurricane::Transformation::Orientation::MX: return "MX";
case Hurricane::Transformation::Orientation::XR: return "XR";
case Hurricane::Transformation::Orientation::MY: return "MY";
case Hurricane::Transformation::Orientation::YR: return "YR";
}
return "ABNORMAL";
}
template<>
inline Hurricane::Record* getRecord<const Hurricane::Transformation::Orientation::Code*>
( const Hurricane::Transformation::Orientation::Code* object )
{
Hurricane::Record* record = new Hurricane::Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
template<>
inline std::string getString<Hurricane::Transformation::Orientation::Code*>
( Hurricane::Transformation::Orientation::Code* object )
{
std::cerr << "Orientation::_getString(): " << std::hex << (void*)&object << " " << (unsigned int)object << std::endl;
switch ( *object ) {
case Hurricane::Transformation::Orientation::ID: return "ID";
case Hurricane::Transformation::Orientation::R1: return "R1";
case Hurricane::Transformation::Orientation::R2: return "R2";
case Hurricane::Transformation::Orientation::R3: return "R3";
case Hurricane::Transformation::Orientation::MX: return "MX";
case Hurricane::Transformation::Orientation::XR: return "XR";
case Hurricane::Transformation::Orientation::MY: return "MY";
case Hurricane::Transformation::Orientation::YR: return "YR";
}
return "ABNORMAL";
}
template<>
inline Hurricane::Record* getRecord<Hurricane::Transformation::Orientation::Code*>
( Hurricane::Transformation::Orientation::Code* object )
{
std::cerr << "Orientation::_getRecord(): " << std::hex << (void*)&object << " " << (unsigned int)object << std::endl;
Hurricane::Record* record = new Hurricane::Record(getString(object));
record->add(getSlot("Code", (unsigned int*)object));
return record;
}
INSPECTOR_PV_SUPPORT(Hurricane::Transformation);
INSPECTOR_PV_SUPPORT(Hurricane::Transformation::Orientation);
IOSTREAM_POINTER_SUPPORT(Hurricane::Transformation::Orientation::Code);
#endif // HURRICANE_TRANSFORMATION

View File

@ -112,7 +112,4 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::TransistorLayer)
# endif

View File

@ -79,8 +79,6 @@ class UpdateSession : public SharedProperty {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::UpdateSession)
#endif // HURRICANE_UPDATE_SESSION
// ****************************************************************************************************

View File

@ -102,7 +102,8 @@ class Vertical : public Segment {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Vertical)
INSPECTOR_P_SUPPORT(Hurricane::Vertical);
#endif // HURRICANE_VERTICAL

View File

@ -105,7 +105,4 @@ namespace Hurricane {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::ViaLayer)
# endif

View File

@ -61,8 +61,6 @@ class Warning : public Exception {
} // End of Hurricane namespace.
SetNestedSlotAdapter(Hurricane::Warning)
#endif // HURRICANE_WARNING
// ****************************************************************************************************

View File

@ -2,6 +2,7 @@
include ( ${QT_USE_FILE} )
include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane
${HURRICANE_SOURCE_DIR}/src/hinspector
${HURRICANE_SOURCE_DIR}/src/hviewer
)

View File

@ -3,142 +3,185 @@
// -*- C++ -*-
# include <QAction>
# include <QMenu>
# include <QMenuBar>
# include <QDockWidget>
#include <QAction>
#include <QMenu>
#include <QMenuBar>
#include <QDockWidget>
# include "hurricane/Cell.h"
#include "hurricane/DataBase.h"
#include "hurricane/Cell.h"
//# include "MapView.h"
# include "hurricane/viewer/Palette.h"
# include "hurricane/viewer/CellWidget.h"
# include "hurricane/viewer/CellViewer.h"
//#include "MapView.h"
#include "hurricane/viewer/Palette.h"
#include "hurricane/viewer/CellWidget.h"
#include "hurricane/viewer/CellViewer.h"
#include "hurricane/inspector/HInspectorWidget.h"
namespace Hurricane {
CellViewer::CellViewer ( Cell* cell ) : QMainWindow()
, _openAction(NULL)
, _nextCellAction(NULL)
, _previousCellAction(NULL)
, _nextAction(NULL)
, _saveAction(NULL)
, _exitAction(NULL)
, _refreshAction(NULL)
, _fitToContentsAction(NULL)
, _showBoundariesAction(NULL)
, _fileMenu(NULL)
, _viewMenu(NULL)
//, _mapView(NULL)
, _palette(NULL)
, _cellWidget(NULL)
{
createMenus ();
createLayout ( cell );
}
CellViewer::CellViewer ( Cell* cell ) : QMainWindow()
, _openAction(NULL)
, _nextCellAction(NULL)
, _previousCellAction(NULL)
, _nextAction(NULL)
, _saveAction(NULL)
, _exitAction(NULL)
, _refreshAction(NULL)
, _fitToContentsAction(NULL)
, _showBoundariesAction(NULL)
, _runInspectorOnDataBase(NULL)
, _runInspectorOnCell(NULL)
, _fileMenu(NULL)
, _viewMenu(NULL)
, _toolsMenu(NULL)
//, _mapView(NULL)
, _palette(NULL)
, _cellWidget(NULL)
{
createMenus ();
createLayout ( cell );
}
void CellViewer::createActions ()
{
if ( _openAction ) return;
void CellViewer::createActions ()
{
if ( _openAction ) return;
_openAction = new QAction ( tr("&Open Cell"), this );
_openAction->setIcon ( QIcon(":/images/stock_open.png") );
_openAction->setStatusTip ( tr("Open (load) a new Cell") );
_openAction = new QAction ( tr("&Open Cell"), this );
_openAction->setIcon ( QIcon(":/images/stock_open.png") );
_openAction->setStatusTip ( tr("Open (load) a new Cell") );
_nextCellAction = new QAction ( tr("Next Cell"), this );
_nextCellAction->setStatusTip ( tr("Go to the next Cell in history") );
_nextCellAction = new QAction ( tr("Next Cell"), this );
_nextCellAction->setStatusTip ( tr("Go to the next Cell in history") );
_previousCellAction = new QAction ( tr("Previous Cell"), this );
_previousCellAction->setStatusTip ( tr("Go to the previous Cell in history") );
_previousCellAction = new QAction ( tr("Previous Cell"), this );
_previousCellAction->setStatusTip ( tr("Go to the previous Cell in history") );
_nextAction = new QAction ( tr("&Next Breakpoint"), this );
_nextAction->setStatusTip ( tr("Proceed to the next breakpoint") );
_nextAction = new QAction ( tr("&Next Breakpoint"), this );
_nextAction->setStatusTip ( tr("Proceed to the next breakpoint") );
_saveAction = new QAction ( tr("&Save Cell"), this );
_saveAction->setIcon ( QIcon(":/images/stock_save.png") );
_saveAction->setStatusTip ( tr("Save the current Cell") );
_saveAction = new QAction ( tr("&Save Cell"), this );
_saveAction->setIcon ( QIcon(":/images/stock_save.png") );
_saveAction->setStatusTip ( tr("Save the current Cell") );
_exitAction = new QAction ( tr("&Exit"), this );
_exitAction->setStatusTip ( tr("Close Coriolis CellViewer") );
_exitAction->setShortcut ( QKeySequence(tr("CTRL+Q")) );
connect ( _exitAction, SIGNAL(triggered()), this, SLOT(close()) );
_exitAction = new QAction ( tr("&Exit"), this );
_exitAction->setStatusTip ( tr("Close Coriolis CellViewer") );
_exitAction->setShortcut ( QKeySequence(tr("CTRL+Q")) );
connect ( _exitAction, SIGNAL(triggered()), this, SLOT(close()) );
_refreshAction = new QAction ( tr("&Refresh"), this );
_refreshAction->setStatusTip ( tr("Force full redrawing of the display") );
_refreshAction->setShortcut ( QKeySequence(tr("CTRL+L")) );
_refreshAction = new QAction ( tr("&Refresh"), this );
_refreshAction->setStatusTip ( tr("Force full redrawing of the display") );
_refreshAction->setShortcut ( QKeySequence(tr("CTRL+L")) );
_fitToContentsAction = new QAction ( tr("&Fit to Contents"), this );
_fitToContentsAction->setStatusTip ( tr("Adjust zoom to fit the whole cell's contents") );
_fitToContentsAction->setShortcut ( Qt::Key_F );
_fitToContentsAction = new QAction ( tr("&Fit to Contents"), this );
_fitToContentsAction->setStatusTip ( tr("Adjust zoom to fit the whole cell's contents") );
_fitToContentsAction->setShortcut ( Qt::Key_F );
_showBoundariesAction = new QAction ( tr("&Boundaries"), this );
_showBoundariesAction->setCheckable ( true );
_showBoundariesAction->setStatusTip ( tr("Show/hide cell & instances abutment boxes") );
}
_showBoundariesAction = new QAction ( tr("&Boundaries"), this );
_showBoundariesAction->setCheckable ( true );
_showBoundariesAction->setStatusTip ( tr("Show/hide cell & instances abutment boxes") );
_runInspectorOnDataBase= new QAction ( tr("Inspect &DataBase"), this );
_runInspectorOnDataBase->setStatusTip ( tr("Run Inspector on Hurricane DataBase") );
_runInspectorOnCell= new QAction ( tr("Inspect &Cell"), this );
_runInspectorOnCell->setStatusTip ( tr("Run Inspector on the current Cell") );
}
void CellViewer::createMenus ()
{
if ( _fileMenu ) return;
if ( !_openAction ) createActions ();
void CellViewer::createMenus ()
{
if ( _fileMenu ) return;
if ( !_openAction ) createActions ();
_fileMenu = menuBar()->addMenu ( tr("File") );
_fileMenu->addAction ( _openAction );
_fileMenu->addAction ( _nextCellAction );
_fileMenu->addAction ( _previousCellAction );
_fileMenu->addAction ( _nextAction );
_fileMenu->addAction ( _saveAction );
_fileMenu->addAction ( _exitAction );
_fileMenu = menuBar()->addMenu ( tr("File") );
_fileMenu->addAction ( _openAction );
_fileMenu->addAction ( _nextCellAction );
_fileMenu->addAction ( _previousCellAction );
_fileMenu->addAction ( _nextAction );
_fileMenu->addAction ( _saveAction );
_fileMenu->addAction ( _exitAction );
_viewMenu = menuBar()->addMenu ( tr("View") );
_viewMenu->addAction ( _refreshAction );
_viewMenu->addAction ( _fitToContentsAction );
_viewMenu->addAction ( _showBoundariesAction );
}
_viewMenu = menuBar()->addMenu ( tr("View") );
_viewMenu->addAction ( _refreshAction );
_viewMenu->addAction ( _fitToContentsAction );
//_viewMenu->addAction ( _showBoundariesAction );
_toolsMenu = menuBar()->addMenu ( tr("Tool") );
_toolsMenu->addAction ( _runInspectorOnDataBase );
_toolsMenu->addAction ( _runInspectorOnCell );
}
void CellViewer::createLayout ( Cell* cell )
{
if ( _cellWidget ) return;
void CellViewer::createLayout ( Cell* cell )
{
if ( _cellWidget ) return;
_cellWidget = new CellWidget ( cell );
_palette = _cellWidget->getPalette();
//_mapView = _cellWidget->getMapView ();
_cellWidget = new CellWidget ( cell );
_palette = _cellWidget->getPalette();
//_mapView = _cellWidget->getMapView ();
setCorner ( Qt::TopLeftCorner , Qt::LeftDockWidgetArea );
setCorner ( Qt::BottomLeftCorner , Qt::LeftDockWidgetArea );
setCorner ( Qt::TopRightCorner , Qt::RightDockWidgetArea );
setCorner ( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
setCorner ( Qt::TopLeftCorner , Qt::LeftDockWidgetArea );
setCorner ( Qt::BottomLeftCorner , Qt::LeftDockWidgetArea );
setCorner ( Qt::TopRightCorner , Qt::RightDockWidgetArea );
setCorner ( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
// QDockWidget* mapViewDock = new QDockWidget ( tr("Map") );
// mapViewDock->setObjectName ( "MapView" );
// mapViewDock->setWidget ( _mapView );
// mapViewDock->setAllowedAreas ( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
// addDockWidget ( Qt::RightDockWidgetArea, mapViewDock );
// QDockWidget* mapViewDock = new QDockWidget ( tr("Map") );
// mapViewDock->setObjectName ( "MapView" );
// mapViewDock->setWidget ( _mapView );
// mapViewDock->setAllowedAreas ( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
// addDockWidget ( Qt::RightDockWidgetArea, mapViewDock );
QDockWidget* layerMapDock = new QDockWidget ( tr("Layers") );
layerMapDock->setObjectName ( "Palette" );
layerMapDock->setWidget ( _palette );
layerMapDock->setAllowedAreas ( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
addDockWidget ( Qt::RightDockWidgetArea, layerMapDock );
QDockWidget* layerMapDock = new QDockWidget ( tr("Layers") );
layerMapDock->setObjectName ( "Palette" );
layerMapDock->setWidget ( _palette );
layerMapDock->setAllowedAreas ( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
addDockWidget ( Qt::RightDockWidgetArea, layerMapDock );
setCentralWidget ( _cellWidget );
setCentralWidget ( _cellWidget );
connect ( _refreshAction , SIGNAL(triggered()) , _cellWidget, SLOT(redraw ()) );
connect ( _fitToContentsAction , SIGNAL(triggered()) , _cellWidget, SLOT(fitToContents()) );
connect ( _refreshAction , SIGNAL(triggered()) , _cellWidget, SLOT(redraw ()));
connect ( _fitToContentsAction , SIGNAL(triggered()) , _cellWidget, SLOT(fitToContents ()));
connect ( _runInspectorOnDataBase, SIGNAL(triggered()) , this , SLOT(runInspectorOnDataBase()));
connect ( _runInspectorOnCell , SIGNAL(triggered()) , this , SLOT(runInspectorOnCell ()));
_showBoundariesAction->setChecked ( _cellWidget->showBoundaries() );
connect ( _showBoundariesAction, SIGNAL(toggled(bool)), _cellWidget, SLOT(setShowBoundaries(bool)) );
//_showBoundariesAction->setChecked ( _cellWidget->showBoundaries() );
//connect ( _showBoundariesAction, SIGNAL(toggled(bool)), _cellWidget, SLOT(setShowBoundaries(bool)) );
_cellWidget->redraw ();
}
_cellWidget->redraw ();
}
void CellViewer::runInspector ( Record* record )
{
//cerr << "INITIAL Records: " << Record::getAllocateds() << endl;
//cerr << "INITIAL Slots: " << Slot::getAllocateds() << endl;
//cerr << "Inspector created." << endl;
if ( record ) {
HInspectorWidget* inspector = new HInspectorWidget ( record );
inspector->show ();
} else
cerr << "[ERROR] Attempt to run Inspector on NULL record." << endl;
}
void CellViewer::runInspectorOnDataBase ()
{
runInspector ( getRecord(DataBase::getDB()) );
}
void CellViewer::runInspectorOnCell ()
{
runInspector ( getRecord(_cellWidget->getCell()) );
}
} // End of Hurricane namespace.

View File

@ -48,13 +48,14 @@ namespace Hurricane {
}
const QFont Graphics::getFixedFont ( bool bold, bool underline )
const QFont Graphics::getFixedFont ( int weight, bool italic, bool underline )
{
const QFont defaultFont = QApplication::font ();
QFont fixedFont ( "Bitstream Vera Sans Mono", defaultFont.pointSize() );
if ( bold ) fixedFont.setBold ( true );
if ( underline ) fixedFont.setUnderline ( true );
fixedFont.setWeight ( weight );
fixedFont.setUnderline ( italic );
fixedFont.setUnderline ( underline );
return fixedFont;
}

View File

@ -44,7 +44,7 @@ namespace Hurricane {
_button = new QPushButton ( this );
_button->setFlat ( true );
_button->setText ( getString(getName()).c_str() );
_button->setFont ( Graphics::getFixedFont(true,true) );
_button->setFont ( Graphics::getFixedFont(QFont::Bold,false,true) );
layout->addWidget ( _button );
layout->addStretch ();
@ -139,9 +139,9 @@ namespace Hurricane {
}
if ( !_expanded )
_button->setFont ( Graphics::getFixedFont(true,true) );
_button->setFont ( Graphics::getFixedFont(QFont::Bold,false,true) );
else
_button->setFont ( Graphics::getFixedFont(true,false) );
_button->setFont ( Graphics::getFixedFont(QFont::Bold,false,false) );
label.insert ( 0, spacingLeft, ' ' );
label.append ( spacingRight, ' ' );

View File

@ -36,7 +36,7 @@ namespace {
}
bool getPattern ( uchar bits[], const string& pattern )
bool getPattern ( uchar bits[], const std::string& pattern )
{
bool isValid = true;

View File

@ -31,6 +31,12 @@ namespace Hurricane {
class CellViewer : public QMainWindow {
Q_OBJECT;
public:
CellViewer ( Cell* cell );
public slots:
void runInspectorOnDataBase ();
void runInspectorOnCell ();
protected:
QAction* _openAction;
QAction* _nextCellAction;
@ -41,23 +47,23 @@ namespace Hurricane {
QAction* _refreshAction;
QAction* _fitToContentsAction;
QAction* _showBoundariesAction;
QAction* _runInspectorOnDataBase;
QAction* _runInspectorOnCell;
QMenu* _fileMenu;
QMenu* _viewMenu;
QMenu* _toolsMenu;
//MapView* _mapView;
Palette* _palette;
CellWidget* _cellWidget;
public:
CellViewer ( Cell* cell );
protected:
void createActions ();
void createMenus ();
void createLayout ( Cell* cell );
void createActions ();
void createMenus ();
void createLayout ( Cell* cell );
void runInspector ( Record* record );
};
} // End of Hurricane namespace.

View File

@ -30,7 +30,7 @@ namespace Hurricane {
public:
// Accessors.
static Graphics* getGraphics ();
static const QFont getFixedFont ( bool bold=false, bool underline=false );
static const QFont getFixedFont ( int weight=-1, bool italic=false, bool underline=false );
static const Name& getGroup ( const Name& key );
static const QColor& getColor ( const Name& key );
static const QPen& getPen ( const Name& key );

View File

@ -103,24 +103,24 @@ extern "C" {
// ---------------------------------------------------------------
// Module Method : "PyDbU_real ()"
// Module Method : "PyDbU_grid ()"
extern PyObject* PyDbU_real ( PyObject* module, PyObject* args )
extern PyObject* PyDbU_grid ( PyObject* module, PyObject* args )
{
trace << "PyDbU_real ()" << endl;
trace << "PyDbU_grid ()" << endl;
PyObject* arg0;
DbU::Unit result = 0;
HTRY
__cs.Init ( "DbU.real" );
if ( ! PyArg_ParseTuple(args,"|O&:DbU.real",Converter,&arg0) )
__cs.Init ( "DbU.grid" );
if ( ! PyArg_ParseTuple(args,"|O&:DbU.grid",Converter,&arg0) )
return ( NULL );
if ( __cs.getObjectIds() == FLOAT_ARG ) { result = DbU::real ( PyFloat_AsDouble ( arg0 ) ); }
if ( __cs.getObjectIds() == FLOAT_ARG ) { result = DbU::grid ( PyFloat_AsDouble ( arg0 ) ); }
else {
PyErr_SetString ( ConstructorError, "invalid number of parameters or bad type for DbU.real converter." );
PyErr_SetString ( ConstructorError, "invalid number of parameters or bad type for DbU.grid converter." );
return ( NULL );
}
@ -173,16 +173,16 @@ extern "C" {
// ---------------------------------------------------------------
// Module Method : "PyDbU_getReal ()"
// Module Method : "PyDbU_getGrid ()"
extern PyObject* PyDbU_getReal ( PyObject* module, PyObject* args )
extern PyObject* PyDbU_getGrid ( PyObject* module, PyObject* args )
{
trace << "PyDbU_getReal ()" << endl;
trace << "PyDbU_getGrid ()" << endl;
PyObject* arg0;
if ( ! ParseOneArg ( "Dbu.getReal", args,INT_ARG, &arg0 ) ) return ( NULL );
if ( ! ParseOneArg ( "Dbu.getGrid", args,INT_ARG, &arg0 ) ) return ( NULL );
return ( Py_BuildValue("d",DbU::getReal(PyInt_AsLong(arg0))) );
return ( Py_BuildValue("d",DbU::getGrid(PyInt_AsLong(arg0))) );
}

View File

@ -524,10 +524,10 @@ extern "C" {
static PyMethodDef PyHurricane_Methods[] =
{ { "DbU_db" , PyDbU_db , METH_VARARGS, "Convert an integer to DbU::Unit (no scale factor)." }
, { "DbU_real" , PyDbU_real , METH_VARARGS, "Convert a real (founder grid) to DbU::Unit." }
, { "DbU_grid" , PyDbU_grid , METH_VARARGS, "Convert a founder grid to DbU::Unit." }
, { "DbU_lambda" , PyDbU_lambda , METH_VARARGS, "Convert a symbolic (lambda) to DbU::Unit." }
, { "DbU_getDb" , PyDbU_getDb , METH_VARARGS, "Convert a DbU::Unit to an integer value (no scale factor)." }
, { "DbU_getReal" , PyDbU_getReal , METH_VARARGS, "Convert a DbU::Unit to a real value (to grid founder)." }
, { "DbU_getGrid" , PyDbU_getGrid , METH_VARARGS, "Convert a DbU::Unit to a to grid founder." }
, { "DbU_getLambda" , PyDbU_getLambda , METH_VARARGS, "Convert a DbU::Unit to a symbolic value (to lambda)." }
, { "getDataBase" , (PyCFunction)PyDataBase_getDataBase , METH_NOARGS , "Get the current DataBase." }
//, { "openUpdateSession" , (PyCFunction)PyUpdateSession_openUpdateSession , METH_NOARGS , "Open an UpdateSession." }

View File

@ -132,8 +132,5 @@ using namespace Hurricane;
} // End of Isobar namespace.
SetNestedSlotAdapter(Isobar::ProxyProperty)
#endif

View File

@ -78,10 +78,10 @@ extern "C" {
// Functions & Types exported to "PyHurricane.ccp".
extern PyObject* PyDbU_db ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_real ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_grid ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_lambda ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_getDb ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_getReal ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_getGrid ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_getLambda ( PyObject* module, PyObject* args );
extern PyObject* PyDbU_getResolution ( PyObject* module );