Skip to content

Commit

Permalink
Remove private headers from Ept headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 29, 2020
1 parent 9882a57 commit 37c4fd0
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 22 deletions.
6 changes: 4 additions & 2 deletions io/EptAddonWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@
#include <pdal/JsonFwd.hpp>
#include <pdal/Writer.hpp>

#include "private/ept/Addon.hpp"

namespace pdal
{

class Addon;
class Connector;
class EptInfo;
class Key;
struct Overlap;
class Pool;
using AddonList = std::vector<Addon>;
using Hierarchy = std::set<Overlap>;

class PDAL_DLL EptAddonWriter : public Writer
{
Expand Down
20 changes: 13 additions & 7 deletions io/EptReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* OF SUCH DAMAGE.
****************************************************************************/

#include "EptReader.hpp"

#include <limits>

#include <pdal/ArtifactManager.hpp>
Expand All @@ -46,9 +44,14 @@
#include "private/ept/Connector.hpp"
#include "private/ept/EptArtifact.hpp"
#include "private/ept/EptSupport.hpp"
#include "private/ept/Key.hpp"
#include "private/ept/Overlap.hpp"
#include "private/ept/Pool.hpp"
#include "private/ept/TileContents.hpp"

#include "EptReader.hpp"


namespace pdal
{

Expand Down Expand Up @@ -412,6 +415,7 @@ void EptReader::ready(PointTableRef table)
m_pointIdDim = table.layout()->findDim("EptPointId");

m_hierarchy.reset(new Hierarchy);
m_hierarchyIter.reset(new Hierarchy::const_iterator);

// Determine all overlapping data files we'll need to fetch.
try
Expand Down Expand Up @@ -451,10 +455,11 @@ void EptReader::ready(PointTableRef table)
else
{
int count = 4;
m_hierarchyIter = m_hierarchy->cbegin();
while (m_hierarchyIter != m_hierarchy->cend() && count)
auto& it = *m_hierarchyIter;
it = m_hierarchy->cbegin();
while (it != m_hierarchy->cend() && count)
{
load(*m_hierarchyIter++);
load(*it++);
count--;
}
}
Expand Down Expand Up @@ -722,8 +727,9 @@ bool EptReader::processOne(PointRef& point)
new TileContents(std::move(m_contents.front())));
m_contents.pop();
l.unlock();
if (m_hierarchyIter != m_hierarchy->cend())
load(*m_hierarchyIter++);
auto& it = *m_hierarchyIter;
if (it != m_hierarchy->cend())
load(*it++);
break;
}
else
Expand Down
14 changes: 7 additions & 7 deletions io/EptReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,30 @@
#include <queue>
#include <memory>
#include <mutex>
#include <set>
#include <condition_variable>

#include <pdal/JsonFwd.hpp>
#include <pdal/Reader.hpp>
#include <pdal/Streamable.hpp>
#include <pdal/util/Bounds.hpp>

#include "private/ept/Addon.hpp"
#include "private/ept/Overlap.hpp"

namespace pdal
{

class Addon;
class Connector;
class EptInfo;
class Key;
struct Overlap;
class Pool;
class TileContents;
using AddonList = std::vector<Addon>;
using Hierarchy = std::set<Overlap>;
using StringMap = std::map<std::string, std::string>;

class PDAL_DLL EptReader : public Reader, public Streamable
{
FRIEND_TEST(EptReaderTest, getRemoteType);
FRIEND_TEST(EptReaderTest, getCoercedType);

public:
EptReader();
virtual ~EptReader();
Expand Down Expand Up @@ -102,7 +102,7 @@ class PDAL_DLL EptReader : public Reader, public Streamable
std::queue<TileContents, std::list<TileContents>> m_contents;
uint64_t m_tileCount;
std::unique_ptr<Hierarchy> m_hierarchy;
Hierarchy::const_iterator m_hierarchyIter;
std::unique_ptr<Hierarchy::const_iterator> m_hierarchyIter;

struct Args;
std::unique_ptr<Args> m_args;
Expand Down
2 changes: 1 addition & 1 deletion io/private/ept/Addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace pdal
point_count_t Addon::points(const Key& key) const
{
auto it = m_hierarchy.find(key);
return (it == m_hierarchy.end() ? 0 : it->m_count);
return (it == m_hierarchy.cend() ? 0 : it->m_count);
}

std::string Addon::dataDir() const
Expand Down
5 changes: 4 additions & 1 deletion io/private/ept/Key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@

#include <functional> // for hash

#include <pdal/pdal_types.hpp>
#include <pdal/util/Bounds.hpp>

namespace pdal
{

class PDAL_DLL Key
class Key
{
// An EPT key representation (see https://git.io/fAiBh). A depth/X/Y/Z key
// representing a data node, as well as the bounds of the contained data.
Expand Down
13 changes: 11 additions & 2 deletions io/private/ept/Overlap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#pragma once

#include <unordered_set>
#include <set>

#include "Key.hpp"

Expand All @@ -53,15 +53,23 @@ struct Overlap
point_count_t m_count;
uint64_t m_nodeId;
};
using Hierarchy = std::unordered_set<Overlap>;
using Hierarchy = std::set<Overlap>;

inline bool operator<(const Overlap& a, const Overlap& b)
{
return a.m_key < b.m_key;
}

/**
inline bool operator==(const Overlap& a, const Overlap& b)
{
return a.m_key == b.m_key;
}
**/

} // namespace pdal

/**
namespace std
{
template<>
Expand All @@ -73,4 +81,5 @@ namespace std
}
};
}
**/

2 changes: 0 additions & 2 deletions pdal/Stage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

#pragma once

#include <list>

#include <pdal/Dimension.hpp>
#include <pdal/DimType.hpp>
#include <pdal/Log.hpp>
Expand Down

0 comments on commit 37c4fd0

Please sign in to comment.