* ./hurricane :

- Cleanup debug messages.
    - New: in NetExternalComponents, adds a static method "isExternal(Component*)",
        used in AP driver.
This commit is contained in:
Jean-Paul Chaput 2009-03-09 09:59:13 +00:00
parent 634af2196f
commit f102af2832
4 changed files with 90 additions and 42 deletions

View File

@ -53,8 +53,6 @@ void DataBase::_postCreate()
void DataBase::_preDestroy()
// ************************
{
cerr << "DataBase::_preDestroy()" << endl;
UpdateSession::open();
Inherit::_preDestroy();

View File

@ -1,23 +1,41 @@
// ****************************************************************************************************
//
// This file is part of the Tsunami Project.
// Copyright (c) 2001-2004 Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie.
//
// File: NetExternalComponents.cpp
// Author: C. Alexandre
// ****************************************************************************************************
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | C O R I O L I S |
// | Alliance / Hurricane Interface |
// | |
// | Author : Christophe Alexandre |
// | E-mail : Christophe.Alexandre@asim.lip6.fr |
// | =============================================================== |
// | C++ Module : "./NetExternalComponents.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include "hurricane/Error.h"
#include "hurricane/Net.h"
#include "hurricane/NetExternalComponents.h"
namespace Hurricane {
const Name NetExternalComponents::_name = "ExternalComponentsRelation";
StandardRelation* NetExternalComponents::getRelation(const Net* net) {
StandardRelation* NetExternalComponents::getRelation ( const Net* net )
{
Property* property = net->getProperty(_name);
if (!property) {
return NULL;
@ -27,28 +45,42 @@ namespace Hurricane {
throw Error("Bad Property type: Must be a Standard Relation");
return relation;
}
}
}
Components NetExternalComponents::get(const Net* net) {
Components NetExternalComponents::get ( const Net* net )
{
if (!net->isExternal())
throw Error("Impossible to retrieve external components on non external net "
+ net->getName()._getString());
throw Error("Impossible to retrieve external components on non external net "
+ net->getName()._getString());
StandardRelation* externalComponentsRelation = getRelation(net);
if (!externalComponentsRelation)
return Components();
return Components();
return externalComponentsRelation->getSlaveOwners().getSubSet<Component*>();
}
}
void NetExternalComponents::setExternal(Component* component) {
void NetExternalComponents::setExternal ( Component* component )
{
Net* net = component->getNet();
if (!net->isExternal())
throw Error("Impossible to set as external a component member of non external net "
+ net->getName()._getString());
throw Error("Impossible to set as external a component member of non external net "
+ net->getName()._getString());
StandardRelation* externalComponentsRelation = getRelation(net);
if (!externalComponentsRelation)
externalComponentsRelation = StandardRelation::create(net, _name);
externalComponentsRelation = StandardRelation::create(net, _name);
component->put(externalComponentsRelation);
}
}
bool NetExternalComponents::isExternal ( Component* component )
{
Net* net = component->getNet();
if (!net->isExternal()) return false;
return getRelation(net) != NULL;
}
} // End of Hurricane namespace.

View File

@ -1,31 +1,51 @@
// ****************************************************************************************************
//
// This file is part of the Tsunami Project.
// Copyright (c) 2001-2004 Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie.
//
// File: NetExternalComponents.h
// Authors: C. Alexandre
// ****************************************************************************************************
#ifndef HURRICANE_NET_EXTERNAL_COMPONENTS
#define HURRICANE_NET_EXTERNAL_COMPONENTS
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | C O R I O L I S |
// | Alliance / Hurricane Interface |
// | |
// | Author : Christophe Alexandre |
// | E-mail : Christophe.Alexandre@asim.lip6.fr |
// | =============================================================== |
// | C++ Header : "./NetExternalComponents.h" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#ifndef __HURRICANE_NET_EXTERNAL_COMPONENTS__
#define __HURRICANE_NET_EXTERNAL_COMPONENTS__
#include "hurricane/Component.h"
#include "hurricane/Relation.h"
#include "hurricane/Component.h"
#include "hurricane/Relation.h"
namespace Hurricane {
class NetExternalComponents {
public:
static Components get ( const Net* );
static void setExternal ( Component* );
static bool isExternal ( Component* );
protected:
static StandardRelation* getRelation ( const Net* );
private:
static const Name _name;
};
} // End of Hurricane namespace.
#endif // HURRICANE_NET_EXTERNAL_COMPONENTS
#endif // __HURRICANE_NET_EXTERNAL_COMPONENTS__

View File

@ -533,8 +533,8 @@ namespace Hurricane {
yimage = 100;
}
cerr << "sy: " << sy << " offsetVA.ry(): " << _cellWidget->getOffsetVA().ry() << endl;
cerr << "w: " << w << " h:" << h << endl;
//cerr << "sy: " << sy << " offsetVA.ry(): " << _cellWidget->getOffsetVA().ry() << endl;
//cerr << "w: " << w << " h:" << h << endl;
if ( _cellWidget->showSelection() )
_painters[PlaneId::Printer].drawPixmap
@ -1000,8 +1000,6 @@ namespace Hurricane {
CellWidget::~CellWidget ()
{
cerr << "CellWidget::~CellWidget()" << endl;
unselectAll ();
for ( size_t i=0 ; i<_commands.size() ; i++ )