Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_driver.cpp
1 
8 #include <iostream>
10 using std::cout;
11 using std::endl;
12 
15 {
18  {
19  cout << "constructing DataBase" << endl;
20  }
24  virtual void add_gds_lib(GdsParser::GdsLib const& lib)
25  {
26  cout << "library name = " << lib.lib_name << endl;
27  cout << "library unit = " << lib.unit[0] << ", " << lib.unit[1] << endl;
28  cout << "# CELL = " << lib.vCell.size() << endl;
29  if (!lib.vCell.empty())
30  {
31  cout << "# BOUNDARY = " << lib.vCell.front().vBoundary.size() << endl;
32  cout << "cell name = " << lib.vCell.front().cell_name << endl;
33  vector<GdsParser::GdsBoundary> const& vBoundary = lib.vCell.front().vBoundary;
34  for (unsigned int i = 0; i < vBoundary.size(); ++i)
35  {
36  cout << ">> BOUNDARY" << endl;
37  cout << "XY: ";
38  for (unsigned int j = 0; j < vBoundary[i].vPoint.size(); ++j)
39  {
40  cout << vBoundary[i].vPoint[j][0] << ", " << vBoundary[i].vPoint[j][1] << endl;
41  }
42  }
43  vector<GdsParser::GdsText> const& vText = lib.vCell.front().vText;
44  for (unsigned int i = 0; i < vText.size(); ++i)
45  {
46  cout << ">> TEXT" << endl;
47  cout << "STRING: " << vText[i].content << endl;
48  cout << "XY: " << vText[i].position[0] << ", " << vText[i].position[1] << endl;
49  }
50  vector<GdsParser::GdsSref> const& vSref = lib.vCell.front().vSref;
51  for (unsigned int i = 0; i < vSref.size(); ++i)
52  {
53  cout << ">> SREF" << endl;
54  cout << "SNAME: " << vSref[i].sname << endl;
55  cout << "XY: " << vSref[i].position[0] << ", " << vSref[i].position[1] << endl;
56  }
57  }
58  }
59 };
60 
65 int main(int argc, char** argv)
66 {
67  DataBase db;
68  if (argc > 1)
69  cout << GdsParser::read(db, argv[1]) << endl;
70  else cout << "at least 1 argument is required" << endl;
71 
72  return 0;
73 }
vector< GdsCell > vCell
Definition: GdsDriver.h:111
database for the driver
Definition: GdsDriver.h:126
Top GDSII library.
Definition: GdsDriver.h:107
virtual void add_gds_lib(GdsParser::GdsLib const &lib)
add GDSII library
Definition: test_driver.cpp:24
high-level wrapper for GdsReader (deprecated)
string lib_name
library name
Definition: GdsDriver.h:109
vector< double > unit
unit
Definition: GdsDriver.h:110
DataBase()
constructor
Definition: test_driver.cpp:17
a database for GdsParser::GdsDriver
Definition: test_driver.cpp:14
int main()
bool read(GdsDriverDataBase &db, string const &filename)
API function for GdsDriver.