19 cout <<
"constructing AsciiDataBase" << endl;
26 virtual void bit_array_cbk(
const char* ascii_record_type,
const char* ascii_data_type, vector<int>
const& vBitArray)
28 cout << __func__ << endl;
29 this->
general_cbk(ascii_record_type, ascii_data_type, vBitArray);
35 virtual void integer_2_cbk(
const char* ascii_record_type,
const char* ascii_data_type, vector<int>
const& vInteger)
37 cout << __func__ << endl;
38 this->
general_cbk(ascii_record_type, ascii_data_type, vInteger);
44 virtual void integer_4_cbk(
const char* ascii_record_type,
const char* ascii_data_type, vector<int>
const& vInteger)
46 cout << __func__ << endl;
47 this->
general_cbk(ascii_record_type, ascii_data_type, vInteger);
53 virtual void real_4_cbk(
const char* ascii_record_type,
const char* ascii_data_type, vector<double>
const& vFloat)
55 cout << __func__ << endl;
56 this->
general_cbk(ascii_record_type, ascii_data_type, vFloat);
62 virtual void real_8_cbk(
const char* ascii_record_type,
const char* ascii_data_type, vector<double>
const& vFloat)
64 cout << __func__ << endl;
65 this->
general_cbk(ascii_record_type, ascii_data_type, vFloat);
71 virtual void string_cbk(
const char* ascii_record_type,
const char* ascii_data_type,
string const& str)
73 cout << __func__ << endl;
74 this->
general_cbk(ascii_record_type, ascii_data_type, str);
80 cout << __func__ << endl;
81 this->
general_cbk(ascii_record_type,
"", vector<int>(0));
90 template <
typename ContainerType>
91 void general_cbk(
string const& ascii_record_type,
string const& ascii_data_type, ContainerType
const& data)
93 cout <<
"ascii_record_type: " << ascii_record_type << endl
94 <<
"ascii_data_type: " << ascii_data_type << endl
95 <<
"data size: " << data.size() << endl;
96 if (ascii_record_type ==
"UNITS")
99 else if (ascii_record_type ==
"BOUNDARY")
102 else if (ascii_record_type ==
"LAYER")
105 else if (ascii_record_type ==
"XY")
107 cout << data.size() << endl;
109 else if (ascii_record_type ==
"ENDEL")
121 cout <<
"constructing EnumDataBase" << endl;
130 cout << __func__ << endl;
131 this->
general_cbk(record_type, data_type, vBitArray);
139 cout << __func__ << endl;
140 this->
general_cbk(record_type, data_type, vInteger);
148 cout << __func__ << endl;
149 this->
general_cbk(record_type, data_type, vInteger);
157 cout << __func__ << endl;
166 cout << __func__ << endl;
175 cout << __func__ << endl;
182 cout << __func__ << endl;
183 this->
general_cbk(record_type, GdsParser::GdsData::NO_DATA, vector<int>(0));
192 template <
typename ContainerType>
197 <<
"data size: " << data.size() << endl;
200 case GdsParser::GdsRecords::UNITS:
202 case GdsParser::GdsRecords::BOUNDARY:
204 case GdsParser::GdsRecords::LAYER:
205 cout <<
"LAYER = " << data[0] << endl;
207 case GdsParser::GdsRecords::XY:
208 for (
typename ContainerType::const_iterator it = data.begin(); it != data.end(); ++it)
211 cout << data.size() << endl;
213 case GdsParser::GdsRecords::ENDEL:
239 int main(
int argc,
char** argv)
248 else cout <<
"at least 1 argument is required" << endl;
AsciiDataBase()
constructor
virtual void real_8_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, vector< double > const &vFloat)
8-byte floating point number callback
virtual void real_8_cbk(const char *ascii_record_type, const char *ascii_data_type, vector< double > const &vFloat)
8-byte floating point number callback
void general_cbk(string const &ascii_record_type, string const &ascii_data_type, ContainerType const &data)
A generic callback function handles all other callback functions. It is not efficient but concise as ...
EnumType
enum type of data type
virtual void real_4_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, vector< double > const &vFloat)
4-byte floating point number callback
virtual void integer_2_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, vector< int > const &vInteger)
2-byte integer callback
virtual void bit_array_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, vector< int > const &vBitArray)
bit array callback
const char * gds_data_ascii(int data_type)
GdsDataBase redirects callbacks of GdsDataBaseKernel to ascii callbacks
virtual void bit_array_cbk(const char *ascii_record_type, const char *ascii_data_type, vector< int > const &vBitArray)
bit array callback
virtual void begin_end_cbk(const char *ascii_record_type)
begin or end indicator of a block
virtual void begin_end_cbk(GdsParser::GdsRecords::EnumType record_type)
begin or end indicator of a block
void general_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, ContainerType const &data)
A generic callback function handles all other callback functions. It is not efficient but concise as ...
int main(int argc, char **argv)
main function
virtual void integer_2_cbk(const char *ascii_record_type, const char *ascii_data_type, vector< int > const &vInteger)
2-byte integer callback
Kernel callbacks for GdsReader. These callbacks use enum for record_type and data_type, which is faster than ascii callbacks.
virtual void real_4_cbk(const char *ascii_record_type, const char *ascii_data_type, vector< double > const &vFloat)
4-byte floating point number callback
const char * gds_record_ascii(int record_type)
virtual void integer_4_cbk(const char *ascii_record_type, const char *ascii_data_type, vector< int > const &vInteger)
4-byte integer callback
virtual void string_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, string const &str)
string callback
virtual void integer_4_cbk(GdsParser::GdsRecords::EnumType record_type, GdsParser::GdsData::EnumType data_type, vector< int > const &vInteger)
4-byte integer callback
EnumType
enum type of GDSII records
virtual void string_cbk(const char *ascii_record_type, const char *ascii_data_type, string const &str)
string callback
EnumDataBase()
constructor
bool read(GdsDriverDataBase &db, string const &filename)
API function for GdsDriver.