Device -> AnalogComponent

empty classes for Resistor and Capacitor
This commit is contained in:
Christophe Alexandre 2008-07-16 00:07:39 +00:00
parent 0ca915b4b8
commit aa8064708c
9 changed files with 95 additions and 9 deletions

View File

@ -1,12 +1,12 @@
#ifndef DEVICE_H
#define DEVICE_H
#ifndef ANALOGCOMPONENT_H
#define ANALOGCOMPONENT_H
#include "hurricane/Cell.h"
using namespace Hurricane;
//#include "DeviceParameter.h"
class Device : public Cell {
class AnalogComponent : public Cell {
#if 0
public:
struct ParameterCompare:
@ -20,7 +20,7 @@ class Device : public Cell {
Parameter* getParameter(const string& parameterId) const;
#endif
protected:
Device(Library* library, const Name& name): Cell(library, name) {}
AnalogComponent(Library* library, const Name& name): Cell(library, name) {}
#if 0
void addParameter(const Parameter* parameter) {
_parameterSet.insert(parameter);
@ -31,4 +31,4 @@ class Device : public Cell {
};
#endif // DEVICE_H
#endif // ANALOGCOMPONENT_H

View File

@ -1,6 +1,6 @@
INCLUDE_DIRECTORIES(${CHAMSIN_SOURCE_DIR}/src/technology ${HURRICANE_INCLUDE_DIR})
ADD_LIBRARY(analogic SHARED Transistor.cpp)
ADD_LIBRARY(analogic SHARED Transistor.cpp Capacitor.cpp Resistor.cpp)
TARGET_LINK_LIBRARIES(analogic atechnology ${HURRICANE_LIBRARIES})

View File

@ -0,0 +1,24 @@
#include "hurricane/UpdateSession.h"
using namespace Hurricane;
#include "Capacitor.h"
Capacitor::Capacitor(Library* library, const Name& name):
AnalogComponent(library, name)
{}
Capacitor* Capacitor::create(Library* library, const Name& name) {
Capacitor* capacitor = new Capacitor(library, name);
capacitor->_postCreate();
return capacitor;
}
void Capacitor::_postCreate() {
Inherit::_postCreate();
UpdateSession::open();
/////
UpdateSession::close();
}

View File

@ -0,0 +1,19 @@
#ifndef CAPACITOR_H
#define CAPACITOR_H
#include "AnalogComponent.h"
class Capacitor : public AnalogComponent {
public:
static Capacitor* create(Library* library, const Name& name);
protected:
void _postCreate();
private:
Capacitor(Library* library, const Name& name);
};
#endif // CAPACITOR_H

View File

@ -0,0 +1,24 @@
#include "hurricane/UpdateSession.h"
using namespace Hurricane;
#include "Resistor.h"
Resistor::Resistor(Library* library, const Name& name):
AnalogComponent(library, name)
{}
Resistor* Resistor::create(Library* library, const Name& name) {
Resistor* resistor = new Resistor(library, name);
resistor->_postCreate();
return resistor;
}
void Resistor::_postCreate() {
Inherit::_postCreate();
UpdateSession::open();
/////
UpdateSession::close();
}

View File

@ -0,0 +1,19 @@
#ifndef RESISTOR_H
#define RESISTOR_H
#include "AnalogComponent.h"
class Resistor : public AnalogComponent {
public:
static Resistor* create(Library* library, const Name& name);
protected:
void _postCreate();
private:
Resistor(Library* library, const Name& name);
};
#endif // RESISTOR_H

View File

@ -48,7 +48,7 @@ Transistor::Type& Transistor::Type::operator=(const Type& type) {
}
Transistor::Transistor(Library* library, const Name& name):
Device(library, name),
AnalogComponent(library, name),
_drain(NULL),
_source(NULL),
_grid(NULL),

View File

@ -1,9 +1,9 @@
#ifndef TRANSISTOR_H
#define TRANSISTOR_H
#include "Device.h"
#include "AnalogComponent.h"
class Transistor : public Device {
class Transistor : public AnalogComponent {
public:
class Type {
public: