diff --git a/src/db/db/dbLayout.cc b/src/db/db/dbLayout.cc index 458f2eda9..b181bd2e0 100644 --- a/src/db/db/dbLayout.cc +++ b/src/db/db/dbLayout.cc @@ -255,6 +255,65 @@ private: bool m_insert; }; +// ----------------------------------------------------------------- +// Implementation of the ProxyContextInfo class + +ProxyContextInfo +ProxyContextInfo::deserialize (std::vector::const_iterator from, std::vector::const_iterator to) +{ + ProxyContextInfo info; + + for (std::vector::const_iterator i = from; i != to; ++i) { + + tl::Extractor ex (i->c_str ()); + + if (ex.test ("LIB=")) { + + info.lib_name = ex.skip (); + + } else if (ex.test ("P(")) { + + std::pair vv; + + ex.read_word_or_quoted (vv.first); + ex.test (")"); + ex.test ("="); + ex.read (vv.second); + + info.pcell_parameters.insert (vv); + + } else if (ex.test ("PCELL=")) { + + info.pcell_name = ex.skip (); + + } else if (ex.test ("CELL=")) { + + info.cell_name = ex.skip (); + + } + + } + + return info; +} + +void +ProxyContextInfo::serialize (std::vector &strings) +{ + if (! lib_name.empty ()) { + strings.push_back ("LIB=" + lib_name); + } + for (std::map ::const_iterator p = pcell_parameters.begin (); p != pcell_parameters.end (); ++p) { + strings.push_back ("P(" + tl::to_word_or_quoted_string (p->first) + ")=" + p->second.to_parsable_string ()); + } + if (! pcell_name.empty ()) { + strings.push_back ("PCELL=" + pcell_name); + } + if (! cell_name.empty ()) { + strings.push_back ("CELL=" + cell_name); + } +} + // ----------------------------------------------------------------- // Implementation of the Layout class @@ -1823,12 +1882,6 @@ Layout::insert_layer (unsigned int index, const LayerProperties &props) layer_properties_changed (); } -unsigned int -Layout::get_layer (const db::LayerProperties &lp) -{ - return m_layers.get_layer (lp); -} - unsigned int Layout::insert_special_layer (const LayerProperties &props) { diff --git a/src/db/db/dbLayout.h b/src/db/db/dbLayout.h index 99ab11d5e..7b7cc1278 100644 --- a/src/db/db/dbLayout.h +++ b/src/db/db/dbLayout.h @@ -1644,7 +1644,18 @@ public: * If there already is a layer matching the given properties, it's index will be * returned. Otherwise a new layer with these properties is created. */ - unsigned int get_layer (const db::LayerProperties &props); + unsigned int get_layer (const db::LayerProperties &props) + { + return m_layers.get_layer (props); + } + + /** + * @brief Gets the layer with the given properties or -1 if such a layer does not exist + */ + int get_layer_maybe (const db::LayerProperties &props) + { + return m_layers.get_layer_maybe (props); + } /** * @brief Insert a new special layer with the given properties diff --git a/src/db/db/dbLayoutLayers.h b/src/db/db/dbLayoutLayers.h index fb0046144..fbe0988bf 100644 --- a/src/db/db/dbLayoutLayers.h +++ b/src/db/db/dbLayoutLayers.h @@ -185,7 +185,7 @@ public: unsigned int get_layer (const db::LayerProperties &props); /** - * @brief Gets or creates a layer with the given properties or -1 if such a layer does not exist. + * @brief Gets the layer with the given properties or -1 if such a layer does not exist. */ int get_layer_maybe (const db::LayerProperties &props);