Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_gdsdb.cpp
Go to the documentation of this file.
1 
8 #include <iostream>
10 #include <limbo/preprocessor/Msg.h>
11 
16 int main(int argc, char** argv)
17 {
19  if (argc > 2 && argc <= 4)
20  {
21  // test simple read and write
22  GdsParser::GdsDB::GdsReader reader (db);
23  limboAssert(reader(argv[1]));
24 
25  for (std::vector<GdsParser::GdsDB::GdsCell>::const_iterator it = db.cells().begin(); it != db.cells().end(); ++it)
26  std::cout << "cell: " << it->name() << std::endl;
27 
28  // write
30  gw(argv[2]);
31 
32  std::cout << "4 arguments to test flatten: input gds, output gds, flat output gds, flat cell name" << std::endl;
33  }
34  else if (argc > 4)
35  {
36  // test flatten
37  GdsParser::GdsDB::GdsCell flatCell = db.extractCell(argv[4]);
38 
40  flatDB.addCell(flatCell);
41 
42  // write flatten cell
43  GdsParser::GdsDB::GdsWriter flatGw (flatDB);
44  flatGw(argv[3]);
45  }
46  else std::cout << "at least 4 arguments are required: input gds, output gds, flat output gds, flat cell name" << std::endl;
47 
48  return 0;
49 }
header to include PrintMsg.h and AssertMsg.h
Wrapper to GDSII read and write with GDSII database GdsParser::GdsDB::GdsDB.
int main(int argc, char **argv)
main function
Definition: test_gdsdb.cpp:16
GdsCell extractCell(std::string const &cellName) const
extract a cell into a new cell with flatten hierarchies
GdsCell & addCell(std::string const &name="")
add a cell and return the reference to the new cell
read GDSII file with GDSII database GdsParser::GdsDB::GdsDB
Definition: GdsIO.h:26
std::vector< GdsCell > const & cells() const
Definition: GdsObjects.h:692
#define limboAssert(condition)
custom assertion without message
Definition: AssertMsg.h:64
write GDSII file with GDSII database GdsParser::GdsDB::GdsDB
Definition: GdsIO.h:118