Ophidian
 All Classes Namespaces Functions
def.h
1 /*
2  * Copyright 2016 Ophidian
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0
12 
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19  */
20 
21 #ifndef OPHIDIAN_PARSING_DEF_H
22 #define OPHIDIAN_PARSING_DEF_H
23 
24 #include <vector>
25 #include <string>
26 #include <DEF/defrReader.hpp>
27 
28 namespace ophidian {
29 namespace parsing {
30 
31 class def {
32 public:
33  template <class T>
34  struct point {
35  T x, y;
36  };
37 
38  struct diearea {
39  point<double> lower;
40  point<double> upper;
41  };
42 
43  struct component {
44  std::string name;
45  std::string macro;
46  std::string orientation;
47  point<double> position;
48  bool fixed;
49  };
50 
51  struct row {
52  std::string name;
53  std::string site;
54  point<double> origin;
55  point<double> step;
56  point<int> num;
57  };
58 
59 
60 private:
61  diearea m_die;
62  double m_units;
63  std::vector<component> m_components;
64  std::vector<row> m_rows;
65 
66 
67 public:
68  def(const std::string & filename);
69  virtual ~def();
70 
71  const diearea & die() const {
72  return m_die;
73  }
74 
75  const std::vector<component> & components() const {
76  return m_components;
77  }
78 
79  const std::vector<row> & rows() const {
80  return m_rows;
81  }
82 
83  double database_units() const {
84  return m_units;
85  }
86 
87 };
88 
89 } /* namespace parsing */
90 } /* namespace ophidian */
91 
92 #endif /* OPHIDIAN_PARSING_DEF_H */
Definition: def.h:31
Definition: def.h:51
Definition: def.h:34