WIP: more changes

This commit is contained in:
Matthias Koefferlein 2020-05-31 10:37:30 +02:00
parent eacd67df1c
commit a9c0616aa0
25 changed files with 213 additions and 71 deletions

View File

@ -43,6 +43,12 @@ AsIfFlatEdgePairs::AsIfFlatEdgePairs ()
// .. nothing yet ..
}
AsIfFlatEdgePairs::AsIfFlatEdgePairs (const AsIfFlatEdgePairs &other)
: EdgePairsDelegate (other), m_bbox_valid (other.m_bbox_valid), m_bbox (other.m_bbox)
{
// .. nothing yet ..
}
AsIfFlatEdgePairs::~AsIfFlatEdgePairs ()
{
// .. nothing yet ..

View File

@ -38,6 +38,7 @@ class DB_PUBLIC AsIfFlatEdgePairs
{
public:
AsIfFlatEdgePairs ();
AsIfFlatEdgePairs (const AsIfFlatEdgePairs &other);
virtual ~AsIfFlatEdgePairs ();
virtual size_t size () const;

View File

@ -59,6 +59,12 @@ AsIfFlatEdges::~AsIfFlatEdges ()
// .. nothing yet ..
}
AsIfFlatEdges::AsIfFlatEdges (const AsIfFlatEdges &other)
: EdgesDelegate (other), m_bbox_valid (false)
{
operator= (other);
}
AsIfFlatEdges &
AsIfFlatEdges::operator= (const AsIfFlatEdges &other)
{

View File

@ -186,6 +186,7 @@ protected:
virtual EdgesDelegate *selected_interacting_generic (const Edges &edges, bool inverse) const;
virtual EdgesDelegate *selected_interacting_generic (const Region &region, bool inverse) const;
AsIfFlatEdges &operator= (const AsIfFlatEdges &other);
AsIfFlatEdges (const AsIfFlatEdges &other);
private:
mutable bool m_bbox_valid;

View File

@ -56,6 +56,12 @@ AsIfFlatRegion::~AsIfFlatRegion ()
// .. nothing yet ..
}
AsIfFlatRegion::AsIfFlatRegion (const AsIfFlatRegion &other)
: RegionDelegate (other), m_bbox_valid (false)
{
operator= (other);
}
AsIfFlatRegion &
AsIfFlatRegion::operator= (const AsIfFlatRegion &other)
{

View File

@ -273,6 +273,7 @@ protected:
static void produce_markers_for_angle_check (const db::Polygon &poly, const Trans &tr, double min, double max, bool inverse, db::Shapes &shapes);
AsIfFlatRegion &operator= (const AsIfFlatRegion &other);
AsIfFlatRegion (const AsIfFlatRegion &other);
private:

View File

@ -46,6 +46,12 @@ AsIfFlatTexts::AsIfFlatTexts ()
// .. nothing yet ..
}
AsIfFlatTexts::AsIfFlatTexts (const AsIfFlatTexts &other)
: TextsDelegate (other), m_bbox_valid (other.m_bbox_valid), m_bbox (other.m_bbox)
{
// .. nothing yet ..
}
AsIfFlatTexts::~AsIfFlatTexts ()
{
// .. nothing yet ..

View File

@ -40,6 +40,7 @@ class DB_PUBLIC AsIfFlatTexts
{
public:
AsIfFlatTexts ();
AsIfFlatTexts (const AsIfFlatTexts &other);
virtual ~AsIfFlatTexts ();
virtual size_t size () const;

View File

@ -151,7 +151,7 @@ void init (const std::vector<std::string> &_paths)
try {
s_plugins.push_back (load_plugin (imp));
modules.insert (*im);
} catch (tl::Exception (&ex)) {
} catch (tl::Exception &ex) {
tl::error << ex.msg ();
}
}

View File

@ -1259,7 +1259,7 @@ PrintingDifferenceReceiver::dbu_differs (double dbu_a, double dbu_b)
{
try {
enough (tl::error) << "Database units differ " << dbu_a << " vs. " << dbu_b;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1269,7 +1269,7 @@ PrintingDifferenceReceiver::layer_in_a_only (const db::LayerProperties &la)
{
try {
enough (tl::error) << "Layer " << la.to_string () << " is not present in layout b, but in a";
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1279,7 +1279,7 @@ PrintingDifferenceReceiver::layer_in_b_only (const db::LayerProperties &lb)
{
try {
enough (tl::error) << "Layer " << lb.to_string () << " is not present in layout a, but in b";
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1290,7 +1290,7 @@ PrintingDifferenceReceiver::layer_name_differs (const db::LayerProperties &la, c
try {
enough (tl::error) << "Layer names differ between layout a and b for layer " << la.layer << "/" << la.datatype << ": "
<< la.name << " vs. " << lb.name;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1300,7 +1300,7 @@ PrintingDifferenceReceiver::cell_in_a_only (const std::string &cellname, db::cel
{
try {
enough (tl::error) << "Cell " << cellname << " is not present in layout b, but in a";
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1310,7 +1310,7 @@ PrintingDifferenceReceiver::cell_in_b_only (const std::string &cellname, db::cel
{
try {
enough (tl::error) << "Cell " << cellname << " is not present in layout a, but in b";
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1320,7 +1320,7 @@ PrintingDifferenceReceiver::cell_name_differs (const std::string &cellname_a, db
{
try {
enough (tl::error) << "Cell " << cellname_a << " in a is renamed to " << cellname_b << " in b";
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1330,7 +1330,7 @@ PrintingDifferenceReceiver::bbox_differs (const db::Box &ba, const db::Box &bb)
{
try {
enough (tl::error) << "Bounding boxes differ for cell " << m_cellname << ", " << ba.to_string () << " vs. " << bb.to_string ();
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1346,7 +1346,7 @@ PrintingDifferenceReceiver::begin_inst_differences ()
{
try {
enough (tl::error) << "Instances differ in cell " << m_cellname;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1369,7 +1369,7 @@ PrintingDifferenceReceiver::instances_in_a_only (const std::vector <db::CellInst
for (std::vector <db::CellInstArrayWithProperties>::const_iterator s = anotb.begin (); s != anotb.end (); ++s) {
print_cell_inst (*s, a);
}
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1382,7 +1382,7 @@ PrintingDifferenceReceiver::instances_in_b_only (const std::vector <db::CellInst
for (std::vector <db::CellInstArrayWithProperties>::const_iterator s = bnota.begin (); s != bnota.end (); ++s) {
print_cell_inst (*s, b);
}
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1404,7 +1404,7 @@ PrintingDifferenceReceiver::per_layer_bbox_differs (const db::Box &ba, const db:
try {
enough (tl::error) << "Per-layer bounding boxes differ for cell " << m_cellname << ", layer (" << m_layer.to_string () << "), "
<< ba.to_string () << " vs. " << bb.to_string ();
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1414,7 +1414,7 @@ PrintingDifferenceReceiver::begin_polygon_differences ()
{
try {
enough (tl::error) << "Polygons differ for layer " << m_layer.to_string () << " in cell " << m_cellname;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1427,7 +1427,7 @@ PrintingDifferenceReceiver::detailed_diff (const db::PropertiesRepository &pr, c
print_diffs (pr, a, b);
enough (tl::info) << "Not in a but in b:";
print_diffs (pr, b, a);
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1442,7 +1442,7 @@ PrintingDifferenceReceiver::begin_path_differences ()
{
try {
enough (tl::error) << "Paths differ for layer " << m_layer.to_string () << " in cell " << m_cellname;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1455,7 +1455,7 @@ PrintingDifferenceReceiver::detailed_diff (const db::PropertiesRepository &pr, c
print_diffs (pr, a, b);
enough (tl::info) << "Not in a but in b:";
print_diffs (pr, b, a);
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1470,7 +1470,7 @@ PrintingDifferenceReceiver::begin_box_differences ()
{
try {
enough (tl::error) << "Boxes differ for layer " << m_layer.to_string () << " in cell " << m_cellname;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1483,7 +1483,7 @@ PrintingDifferenceReceiver::detailed_diff (const db::PropertiesRepository &pr, c
print_diffs (pr, a, b);
enough (tl::info) << "Not in a but in b:";
print_diffs (pr, b, a);
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1498,7 +1498,7 @@ PrintingDifferenceReceiver::begin_edge_differences ()
{
try {
enough (tl::error) << "Edges differ for layer " << m_layer.to_string () << " in cell " << m_cellname;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1511,7 +1511,7 @@ PrintingDifferenceReceiver::detailed_diff (const db::PropertiesRepository &pr, c
print_diffs (pr, a, b);
enough (tl::info) << "Not in a but in b:";
print_diffs (pr, b, a);
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1526,7 +1526,7 @@ PrintingDifferenceReceiver::begin_text_differences ()
{
try {
enough (tl::error) << "Texts differ for layer " << m_layer.to_string () << " in cell " << m_cellname;
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}
@ -1539,7 +1539,7 @@ PrintingDifferenceReceiver::detailed_diff (const db::PropertiesRepository &pr, c
print_diffs (pr, a, b);
enough (tl::info) << "Not in a but in b:";
print_diffs (pr, b, a);
} catch (tl::CancelException) {
} catch (tl::CancelException &) {
// ignore cancel exceptions
}
}

View File

@ -97,14 +97,6 @@ public:
// .. nothing yet ..
}
/**
* @brief Copy ctor
*/
Matrix2d (const Matrix2d &d)
{
*this = d;
}
/**
* @brief Make a matrix from a transformation
*/
@ -522,14 +514,6 @@ public:
set (d, 0.0, 0.0, 0.0, d, 0.0, 0.0, 0.0, 1.0);
}
/**
* @brief Copy ctor
*/
Matrix3d (const Matrix3d &d)
{
*this = d;
}
/**
* @brief Add operator
*/

View File

@ -83,6 +83,18 @@ public:
*/
point (const point<C> &d) : m_x (d.x ()), m_y (d.y ()) { }
/**
* @brief Assignment
*
* @param d The source from which to take the data
*/
point &operator= (const point<C> &d)
{
m_x = d.x ();
m_y = d.y ();
return *this;
}
/**
* @brief The copy constructor that also converts
*
@ -94,6 +106,21 @@ public:
template <class D>
explicit point (const point<D> &d) : m_x (coord_traits::rounded (d.x ())), m_y (coord_traits::rounded (d.y ())) { }
/**
* @brief Assignment which also converts
*
* This assignment operator will convert the coordinate types if possibel
*
* @param d The source from which to take the data
*/
template <class D>
point &operator= (const point<C> &d)
{
m_x = coord_traits::rounded (d.x ());
m_y = coord_traits::rounded (d.y ());
return *this;
}
/**
* @brief Add to operation
*/

View File

@ -338,7 +338,7 @@ Shape::simple_polygon_ref_type Shape::simple_polygon_ref () const
{
if (m_type == SimplePolygonRef) {
return *basic_ptr (simple_polygon_ref_type::tag ());
} else if (SimplePolygonPtrArrayMember) {
} else if (m_type == SimplePolygonPtrArrayMember) {
tl_assert (m_trans.rot () == 0);
return simple_polygon_ref_type (&basic_ptr (simple_polygon_ptr_array_type::tag ())->object ().obj (), m_trans.disp ());
} else {

View File

@ -67,15 +67,6 @@ public:
// .. nothing yet ..
}
/**
* @brief The copy constructor
*/
repository (const repository<Sh> &d)
: m_set (d.m_set)
{
// .. nothing yet ..
}
/**
* @brief Insert a shape into the repository
*

View File

@ -150,11 +150,19 @@ struct unit_trans
// .. nothing else ..
}
/**
* @brief Copy ctor (which basically does nothing)
*/
unit_trans (const unit_trans<C> &)
{
// .. nothing else ..
}
/**
* @brief Copy ctor (which basically does nothing)
*/
template <class D>
explicit unit_trans (const unit_trans<D> &)
unit_trans (const unit_trans<D> &)
{
// .. nothing else ..
}
@ -240,6 +248,15 @@ struct unit_trans
return *this;
}
/**
* @brief Assignment (which basically does nothing)
*/
template <class D>
unit_trans &operator= (const unit_trans<D> &)
{
return *this;
}
/**
* @brief Inversion
*/
@ -730,12 +747,21 @@ public:
/**
* @brief The "conversion" from the unit transformation to a displacement
*/
explicit disp_trans (unit_trans<C>)
disp_trans (unit_trans<C>)
: m_u ()
{
// .. nothing else ..
}
/**
* @brief The copy constructor
*
* @param d The source from which to copy
*/
disp_trans (const disp_trans<C> &d)
: m_u (d.disp ())
{ }
/**
* @brief The copy constructor that converts also
*
@ -745,7 +771,7 @@ public:
* @param d The source from which to copy
*/
template <class D>
explicit disp_trans (const disp_trans<D> &d)
disp_trans (const disp_trans<D> &d)
: m_u (d.disp ())
{ }
@ -779,6 +805,25 @@ public:
// .. nothing else ..
}
/**
* @brief Assignment
*/
disp_trans &operator= (const disp_trans<C> &d)
{
m_u = d.disp ();
return *this;
}
/**
* @brief Assignment with type conversion
*/
template <class D>
disp_trans &operator= (const disp_trans<D> &d)
{
m_u = d.disp ();
return *this;
}
/**
* @brief Returns true, if the transformation is unity
*/
@ -1090,6 +1135,18 @@ public:
: fixpoint_trans<C> (d.rot ()), m_u (d.disp ())
{ }
/**
* @brief Assignment
*
* @param d The source from which to take the data
*/
simple_trans &operator= (const simple_trans<C> &d)
{
fixpoint_trans<C>::operator= (d);
m_u = d.disp ();
return *this;
}
/**
* @brief The copy constructor that converts to a different coordinate type also
*
@ -1103,6 +1160,22 @@ public:
: fixpoint_trans<C> (d.rot ()), m_u (d.disp ())
{ }
/**
* @brief Assignment which also converts
*
* This assignment implementation will also convert
* between different coordinate types if possible.
*
* @param d The source from which to take the data
*/
template <class D>
simple_trans &operator= (const simple_trans<D> &d)
{
fixpoint_trans<C>::operator= (d);
m_u = d.disp ();
return *this;
}
/**
* @brief The standard constructor using angle and mirror flag
*

View File

@ -126,6 +126,18 @@ public:
// .. nothing yet ..
}
/**
* @brief Assignment
*
* @param d The source from which to take the data
*/
vector &operator= (const vector<C> &d)
{
m_x = d.x ();
m_y = d.y ();
return *this;
}
/**
* @brief The copy constructor that converts also
*
@ -141,6 +153,21 @@ public:
// .. nothing yet ..
}
/**
* @brief Assignment which also converts
*
* This assignment operator will convert the coordinate types if possibel
*
* @param d The source from which to take the data
*/
template <class D>
vector &operator= (const point<C> &d)
{
m_x = coord_traits::rounded (d.x ());
m_y = coord_traits::rounded (d.y ());
return *this;
}
/**
* @brief Add to operation
*/

View File

@ -248,9 +248,9 @@ Class<db::LayoutToNetlist> decl_dbLayoutToNetlist ("db", "LayoutToNetlist",
gsi::method ("layer_name", (std::string (db::LayoutToNetlist::*) (unsigned int) const) &db::LayoutToNetlist::name, gsi::arg ("l"),
"@brief Gets the name of the given layer (by index)\n"
) +
gsi::method ("register", (void (db::LayoutToNetlist::*) (const db::Region &region, const std::string &)) &db::LayoutToNetlist::register_layer, gsi::arg ("l"), gsi::arg ("n"),
gsi::method ("register", (void (db::LayoutToNetlist::*) (const db::ShapeCollection &collection, const std::string &)) &db::LayoutToNetlist::register_layer, gsi::arg ("l"), gsi::arg ("n"),
"@brief Names the given layer\n"
"'l' must be a hierarchical region derived with \\make_layer, \\make_text_layer or \\make_polygon_layer or "
"'l' must be a hierarchical \\Region or \\Texts object derived with \\make_layer, \\make_text_layer or \\make_polygon_layer or "
"a region derived from those by boolean operations or other hierarchical operations.\n"
"\n"
"Naming a layer allows the system to indicate the layer in various contexts, i.e. "
@ -258,13 +258,8 @@ Class<db::LayoutToNetlist> decl_dbLayoutToNetlist ("db", "LayoutToNetlist",
"They are not discarded when the Region object is destroyed.\n"
"\n"
"If required, the system will assign a name automatically."
) +
gsi::method ("register", (void (db::LayoutToNetlist::*) (const db::Texts &texts, const std::string &)) &db::LayoutToNetlist::register_layer, gsi::arg ("l"), gsi::arg ("n"),
"@brief Names the given layer\n"
"This method behaves like the one provided for Regions but accepts Texts. "
"Texts (hierarchical text collections) are useful to represent labels for naming nets.\n"
"\n"
"This variant has been introduced in version 0.27.\n"
"This method has been generalized in version 0.27.\n"
) +
gsi::method_ext ("layer_names", &l2n_layer_names,
"@brief Returns a list of names of the layer kept inside the LayoutToNetlist object."

View File

@ -883,7 +883,7 @@ protected:
}
private:
event_type (X::*mp_event);
event_type X::*mp_event;
};
template <class X, class E, class H, class T>

View File

@ -423,6 +423,15 @@ X::X (const X &x)
++s_xinst;
}
X &X::operator= (const X &x)
{
gsi::ObjectBase::operator= (x);
if (this != &x) {
m_s = x.m_s;
}
return *this;
}
X::~X ()
{
--s_xinst;

View File

@ -1022,6 +1022,7 @@ public:
X ();
X (const char *x);
X (const X &x);
X &operator= (const X &x);
virtual ~X ();
int x1 () const { return 17; }

View File

@ -154,7 +154,7 @@ Class<lay::AbstractMenu> decl_AbstractMenu ("lay", "AbstractMenu",
"@param path The path to check\n"
"@return false if the path is not a valid path to an item\n"
) +
method ("insert_item", (void (lay::AbstractMenu::*) (const std::string &, const std::string &, const lay::Action &)) &lay::AbstractMenu::insert_item, gsi::arg ("path"), gsi::arg ("name"), gsi::arg ("action"),
method ("insert_item", (void (lay::AbstractMenu::*) (const std::string &, const std::string &, const lay::Action *)) &lay::AbstractMenu::insert_item, gsi::arg ("path"), gsi::arg ("name"), gsi::arg ("action"),
"@brief Inserts a new item before the one given by the path\n"
"\n"
"The Action object passed as the third parameter references the handler which both implements the "

View File

@ -209,7 +209,7 @@ public:
std::vector<std::string> to_strings () const;
private:
uint32_t *(m_pattern[64]);
uint32_t *m_pattern[64];
uint32_t m_buffer [64 * 32];
unsigned int m_width, m_height;
unsigned int m_pattern_stride;

View File

@ -115,7 +115,7 @@ public:
{
T *t = dynamic_cast<T *> (object);
if (t) {
void *(argv[]) = { _CALLARGPTRS };
void *argv[] = { _CALLARGPTRS };
(t->*m_m) (_COUNT, &(argv[0]));
}
}
@ -145,7 +145,7 @@ public:
{
T *t = dynamic_cast<T *> (object);
if (t) {
void *(argv[]) = { _CALLARGPTRS };
void *argv[] = { _CALLARGPTRS };
(t->*m_m) (m_d, _COUNT, &(argv[0]));
}
}

View File

@ -260,10 +260,6 @@ public:
: m_begin (begin), m_step (step), m_index (index)
{ }
kd_n_it (const kd_n_it &i)
: m_begin (i.m_begin), m_step (i.m_step), m_index (i.m_index)
{ }
kd_n_it (size_type step, const kd_n_it &i)
: m_begin (i.m_begin), m_step (step), m_index (i.m_index)
{ }

View File

@ -58,12 +58,23 @@ public:
/**
* @brief Copy constructor
*/
explicit vector (const tl::vector<T> &d) : std::vector<T> (d) { }
explicit vector (const tl::vector<T> &d) : base (d) { }
/**
* @brief Assignment
*/
vector &operator= (const tl::vector<T> &d)
{
if (&d != this) {
base::operator= (d);
}
return *this;
}
/**
* @brief Initialization with value and length
*/
vector (const T &v, int s) : std::vector<T> (v, s) { }
vector (const T &v, int s) : base (v, s) { }
};
/**