Skip to content

Commit

Permalink
Add isEmpty to qgs generic spatial index
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jan 10, 2020
1 parent 4b0747c commit 30fbed4
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgsgenericspatialindex.h
Expand Up @@ -130,6 +130,15 @@ class CORE_EXPORT QgsGenericSpatialIndex
return true;
}

/**
* Returns TRUE if the index contains no items.
*/
bool isEmpty( ) const
{
QMutexLocker locker( &mMutex );
return mIdToData.isEmpty();
}

private:

std::unique_ptr< SpatialIndex::ISpatialIndex > createSpatialIndex( SpatialIndex::IStorageManager &storageManager )
Expand Down
21 changes: 21 additions & 0 deletions src/providers/postgres/raster/qgspostgresrastershareddata.cpp
@@ -0,0 +1,21 @@
/***************************************************************************
qgspostgresrastershareddata.cpp - QgsPostgresRasterSharedData
---------------------
begin : 8.1.2020
copyright : (C) 2020 by Alessandro Pasotti
email : elpaso at itopen dot it
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgspostgresrastershareddata.h"

QgsPostgresRasterSharedData::QgsPostgresRasterSharedData()
{

}
26 changes: 26 additions & 0 deletions src/providers/postgres/raster/qgspostgresrastershareddata.h
@@ -0,0 +1,26 @@
/***************************************************************************
qgspostgresrastershareddata.h - QgsPostgresRasterSharedData
---------------------
begin : 8.1.2020
copyright : (C) 2020 by Alessandro Pasotti
email : elpaso at itopen dot it
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSPOSTGRESRASTERSHAREDDATA_H
#define QGSPOSTGRESRASTERSHAREDDATA_H


class QgsPostgresRasterSharedData
{
public:
QgsPostgresRasterSharedData();
};

#endif // QGSPOSTGRESRASTERSHAREDDATA_H
21 changes: 21 additions & 0 deletions src/providers/postgres/raster/qgspostgresrasterutils.cpp
@@ -0,0 +1,21 @@
/***************************************************************************
qgspostgresrasterutils.cpp - QgsPostgresRasterUtils
---------------------
begin : 8.1.2020
copyright : (C) 2020 by Alessandro Pasotti
email : elpaso at itopen dot it
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgspostgresrasterutils.h"

QgsPostgresRasterUtils::QgsPostgresRasterUtils()
{

}
26 changes: 26 additions & 0 deletions src/providers/postgres/raster/qgspostgresrasterutils.h
@@ -0,0 +1,26 @@
/***************************************************************************
qgspostgresrasterutils.h - QgsPostgresRasterUtils
---------------------
begin : 8.1.2020
copyright : (C) 2020 by Alessandro Pasotti
email : elpaso at itopen dot it
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSPOSTGRESRASTERUTILS_H
#define QGSPOSTGRESRASTERUTILS_H


class QgsPostgresRasterUtils
{
public:
QgsPostgresRasterUtils();
};

#endif // QGSPOSTGRESRASTERUTILS_H

0 comments on commit 30fbed4

Please sign in to comment.