From a4567397b40d2f64d142615dfebb5760ee456176 Mon Sep 17 00:00:00 2001 From: Alastair Porter Date: Thu, 19 Mar 2020 13:47:24 +0100 Subject: [PATCH] Provide forward declaration of <> operators Don't only define these methods in the friend declaration --- src/dataset.h | 22 ++++++++++++---------- src/descriptortree.h | 22 ++++++++++++---------- src/point.h | 25 +++++++++++++++---------- src/pointlayout.h | 23 +++++++++++++---------- src/region.h | 22 ++++++++++++---------- 5 files changed, 64 insertions(+), 50 deletions(-) diff --git a/src/dataset.h b/src/dataset.h index b835308..ede3005 100644 --- a/src/dataset.h +++ b/src/dataset.h @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Gaia - * - * Gaia is free software: you can redistribute it and/or modify it under - * the terms of the GNU Affero General Public License as published by the Free - * Software Foundation (FSF), either version 3 of the License, or (at your + * + * Gaia is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation (FSF), either version 3 of the License, or (at your * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ @@ -488,6 +488,8 @@ class DataSet : public PointArray, public QObject { }; +QDataStream& operator<<(QDataStream& out, const DataSet& dataset); +QDataStream& operator>>(QDataStream& in, DataSet& dataset); } // namespace gaia2 diff --git a/src/descriptortree.h b/src/descriptortree.h index 079d4ec..cbf468c 100644 --- a/src/descriptortree.h +++ b/src/descriptortree.h @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Gaia - * - * Gaia is free software: you can redistribute it and/or modify it under - * the terms of the GNU Affero General Public License as published by the Free - * Software Foundation (FSF), either version 3 of the License, or (at your + * + * Gaia is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation (FSF), either version 3 of the License, or (at your * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ @@ -313,6 +313,8 @@ class DescriptorTree { friend QDataStream& operator>>(QDataStream& in, DescriptorTree& tree); }; +QDataStream& operator<<(QDataStream& out, const DescriptorTree& tree); +QDataStream& operator>>(QDataStream& in, DescriptorTree& tree); } // namespace gaia2 diff --git a/src/point.h b/src/point.h index ed6a8a5..c73d607 100644 --- a/src/point.h +++ b/src/point.h @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Gaia - * - * Gaia is free software: you can redistribute it and/or modify it under - * the terms of the GNU Affero General Public License as published by the Free - * Software Foundation (FSF), either version 3 of the License, or (at your + * + * Gaia is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation (FSF), either version 3 of the License, or (at your * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ @@ -69,6 +69,9 @@ class Scope { friend QDataStream& operator>>(QDataStream& in, Scope& scope); }; +QDataStream& operator<<(QDataStream& out, const Scope& scope); +QDataStream& operator>>(QDataStream& in, Scope& scope); + class ScopedData { public: Scope scope; @@ -309,6 +312,8 @@ class Point { friend QDataStream& operator>>(QDataStream& in, Point& point); }; +QDataStream& operator<<(QDataStream& out, const Point& point); +QDataStream& operator>>(QDataStream& in, Point& point); // some useful defines that will be used in lots of places #define FORSEG(p) for (int nseg=0; nseg<(p).numberSegments(); nseg++) diff --git a/src/pointlayout.h b/src/pointlayout.h index 2484f95..b30770e 100644 --- a/src/pointlayout.h +++ b/src/pointlayout.h @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Gaia - * - * Gaia is free software: you can redistribute it and/or modify it under - * the terms of the GNU Affero General Public License as published by the Free - * Software Foundation (FSF), either version 3 of the License, or (at your + * + * Gaia is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation (FSF), either version 3 of the License, or (at your * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ @@ -324,6 +324,9 @@ class PointLayout { }; +QDataStream& operator<<(QDataStream& out, const PointLayout& layout); +QDataStream& operator>>(QDataStream& in, PointLayout& layout); + } // namespace gaia2 #endif // GAIA_POINTLAYOUT_H diff --git a/src/region.h b/src/region.h index 7cb2544..92b4546 100644 --- a/src/region.h +++ b/src/region.h @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Gaia - * - * Gaia is free software: you can redistribute it and/or modify it under - * the terms of the GNU Affero General Public License as published by the Free - * Software Foundation (FSF), either version 3 of the License, or (at your + * + * Gaia is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation (FSF), either version 3 of the License, or (at your * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ @@ -117,6 +117,8 @@ class Segment { friend QDataStream& operator>>(QDataStream& in, Segment& segment); }; +QDataStream& operator<<(QDataStream& out, const Segment& segment); +QDataStream& operator>>(QDataStream& in, Segment& segment); /** * A region is a physical location in the point layout which consists in a list