new format for technology

technology is now a private property of Hurricane Technology
This commit is contained in:
Christophe Alexandre 2008-05-05 11:07:14 +00:00
parent 7ceb8530f2
commit 3ada159bd7
6 changed files with 120 additions and 1 deletions

View File

@ -1,4 +1,5 @@
ADD_SUBDIRECTORY(dtr) ADD_SUBDIRECTORY(dtr)
ADD_SUBDIRECTORY(technology)
ADD_SUBDIRECTORY(analogic) ADD_SUBDIRECTORY(analogic)
ADD_SUBDIRECTORY(device) ADD_SUBDIRECTORY(device)
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)

View File

@ -0,0 +1,44 @@
#include "Technology.h"
#include "Property.h"
using namespace Hurricane;
#include "ATechnology.h"
namespace {
static Name ATechnologyPropertyName("ATechnologyProperty");
class ATechnologyProperty : public PrivateProperty {
public:
typedef PrivateProperty Inherit;
static ATechnologyProperty* create(Technology* technology);
ATechnologyProperty();
virtual Name getName() const {
return ATechnologyPropertyName;
}
virtual string _getTypeName() const {
return _TName("ATechnologyProperty");
}
};
ATechnologyProperty::ATechnologyProperty():
Inherit()
{}
ATechnologyProperty* ATechnologyProperty::create(Technology* technology) {
ATechnologyProperty* prop = new ATechnologyProperty();
prop->_postCreate();
technology->put(prop);
return prop;
}
}

View File

@ -0,0 +1,8 @@
#ifndef ATECHNOLOGY_H_
#define ATECHNOLOGY_H_
class ATechnology {
};
#endif /* ATECHNOLOGY_H_*/

View File

@ -0,0 +1,8 @@
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR})
ADD_LIBRARY(atechnology SHARED
ATechnology.cpp TechnologyXmlParser.cpp)
TARGET_LINK_LIBRARIES(atechnology ${HURRICANE_LIBRARIES} ${LIBXML2_LIBRARIES})
INSTALL(TARGETS atechnology DESTINATION /lib)

View File

@ -0,0 +1,43 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
#include "Technology.h"
using namespace Hurricane;
#include "TechnologyXmlParser.h"
namespace {
ATechnology* parseFileAsTechnology(const char* filePath) {
xmlDocPtr doc; /* the resulting document tree */
doc = xmlReadFile(filePath, NULL, 0);
if (doc == NULL) {
fprintf(stderr, "Failed to parse %s\n", filePath);
exit(5);
}
/*Get the design element node */
xmlNode* rootElement = xmlDocGetRootElement(doc);
if (rootElement->type == XML_ELEMENT_NODE && xmlStrEqual(rootElement->name, (xmlChar*)"technology")) {
}
}
}
ATechnology* parseTechnologyFromXml(const char* filePath, Technology* technology) {
LIBXML_TEST_VERSION
// Cell* rootCell = parseFileAsCell(filePath.c_str());
xmlCleanupParser();
/*
* this is to debug memory for regression tests
*/
xmlMemoryDump();
return NULL;
}

View File

@ -0,0 +1,15 @@
#ifndef TECHNOLOGYXMLPARSER_H_
#define TECHNOLOGYXMLPARSER_H_
namespace Hurricane {
class Technology;
}
class ATechnology;
class TechnologyXmlParser {
public:
static ATechnology* parseTechnologyFromXml(const char* filePath, Hurricane::Technology* technology);
};
#endif /*TECHNOLOGYXMLPARSER_H_*/