[Liblas-commits] libpc: rename libpc::Reader to libpc::Producer

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Mar 7 15:37:24 EST 2011


details:   http://hg.liblas.orglibpc/rev/52486659a751
changeset: 182:52486659a751
user:      Howard Butler <hobu.inc at gmail.com>
date:      Mon Mar 07 14:37:14 2011 -0600
description:
rename libpc::Reader to libpc::Producer

diffstat:

 include/libpc/FauxReader.hpp  |   4 +-
 include/libpc/LasReader.hpp   |   4 +-
 include/libpc/Producer.hpp    |  71 ++++++++++++++++++++++++++++++++
 include/libpc/Reader.hpp      |  71 --------------------------------
 src/CMakeLists.txt            |   4 +-
 src/FauxReader.cpp            |   4 +-
 src/LasReader.cpp             |   2 +-
 src/Producer.cpp              |  94 +++++++++++++++++++++++++++++++++++++++++++
 src/Reader.cpp                |  94 -------------------------------------------
 src/drivers/liblas/reader.cpp |   2 +-
 src/drivers/liblas/reader.hpp |   4 +-
 11 files changed, 177 insertions(+), 177 deletions(-)

diffs (truncated from 473 to 300 lines):

diff -r 2db88a88b578 -r 52486659a751 include/libpc/FauxReader.hpp
--- a/include/libpc/FauxReader.hpp	Mon Mar 07 14:07:33 2011 -0600
+++ b/include/libpc/FauxReader.hpp	Mon Mar 07 14:37:14 2011 -0600
@@ -35,7 +35,7 @@
 #ifndef INCLUDED_FAUXREADER_HPP
 #define INCLUDED_FAUXREADER_HPP
 
-#include "libpc/Reader.hpp"
+#include "libpc/Producer.hpp"
 
 namespace libpc
 {
@@ -53,7 +53,7 @@
 // points to always be at the minimum of the bounding box.  The Time field
 // is always set to the point number.
 //
-class LIBPC_DLL FauxReader : public Reader
+class LIBPC_DLL FauxReader : public Producer
 {
 public:
     enum Mode
diff -r 2db88a88b578 -r 52486659a751 include/libpc/LasReader.hpp
--- a/include/libpc/LasReader.hpp	Mon Mar 07 14:07:33 2011 -0600
+++ b/include/libpc/LasReader.hpp	Mon Mar 07 14:37:14 2011 -0600
@@ -37,13 +37,13 @@
 
 #include <iostream>
 
-#include "libpc/Reader.hpp"
+#include "libpc/Producer.hpp"
 #include "libpc/LasHeader.hpp"
 
 namespace libpc
 {
 
-class LIBPC_DLL LasReader : public Reader
+class LIBPC_DLL LasReader : public Producer
 {
 public:
     LasReader(std::istream&);
diff -r 2db88a88b578 -r 52486659a751 include/libpc/Producer.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/Producer.hpp	Mon Mar 07 14:37:14 2011 -0600
@@ -0,0 +1,71 @@
+/******************************************************************************
+* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following
+* conditions are met:
+*
+*     * Redistributions of source code must retain the above copyright
+*       notice, this list of conditions and the following disclaimer.
+*     * Redistributions in binary form must reproduce the above copyright
+*       notice, this list of conditions and the following disclaimer in
+*       the documentation and/or other materials provided
+*       with the distribution.
+*     * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
+*       names of its contributors may be used to endorse or promote
+*       products derived from this software without specific prior
+*       written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+* OF SUCH DAMAGE.
+****************************************************************************/
+
+#ifndef INCLUDED_PRODUCER_HPP
+#define INCLUDED_PRODUCER_HPP
+
+#include "libpc/Stage.hpp"
+#include "libpc/Header.hpp"
+
+namespace libpc
+{
+
+class LIBPC_DLL Producer : public Stage
+{
+public:
+    Producer();
+
+    virtual void readBegin(boost::uint32_t numPointsToRead);
+
+    virtual void readEnd(boost::uint32_t numPointsRead);
+
+    // default is to reset() and then read N points manually
+    // override this if you can
+    virtual void seekToPoint(boost::uint64_t pointNum);
+
+    virtual boost::uint64_t getCurrentPointIndex() const;
+
+protected:
+    void setCurrentPointIndex(boost::uint64_t);
+
+private:
+    boost::uint64_t m_currentPointIndex;
+
+    Producer& operator=(const Producer&); // not implemented
+    Producer(const Producer&); // not implemented
+};
+
+} // namespace libpc
+
+#endif
diff -r 2db88a88b578 -r 52486659a751 include/libpc/Reader.hpp
--- a/include/libpc/Reader.hpp	Mon Mar 07 14:07:33 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following
-* conditions are met:
-*
-*     * Redistributions of source code must retain the above copyright
-*       notice, this list of conditions and the following disclaimer.
-*     * Redistributions in binary form must reproduce the above copyright
-*       notice, this list of conditions and the following disclaimer in
-*       the documentation and/or other materials provided
-*       with the distribution.
-*     * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
-*       names of its contributors may be used to endorse or promote
-*       products derived from this software without specific prior
-*       written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-* OF SUCH DAMAGE.
-****************************************************************************/
-
-#ifndef INCLUDED_READER_HPP
-#define INCLUDED_READER_HPP
-
-#include "libpc/Stage.hpp"
-#include "libpc/Header.hpp"
-
-namespace libpc
-{
-
-class LIBPC_DLL Reader : public Stage
-{
-public:
-    Reader();
-
-    virtual void readBegin(boost::uint32_t numPointsToRead);
-
-    virtual void readEnd(boost::uint32_t numPointsRead);
-
-    // default is to reset() and then read N points manually
-    // override this if you can
-    virtual void seekToPoint(boost::uint64_t pointNum);
-
-    virtual boost::uint64_t getCurrentPointIndex() const;
-
-protected:
-    void setCurrentPointIndex(boost::uint64_t);
-
-private:
-    boost::uint64_t m_currentPointIndex;
-
-    Reader& operator=(const Reader&); // not implemented
-    Reader(const Reader&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r 2db88a88b578 -r 52486659a751 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Mon Mar 07 14:07:33 2011 -0600
+++ b/src/CMakeLists.txt	Mon Mar 07 14:37:14 2011 -0600
@@ -44,7 +44,7 @@
   ${LIBPC_HEADERS_DIR}/Vector.hpp  
   ${LIBPC_HEADERS_DIR}/PointData.hpp  
   ${LIBPC_HEADERS_DIR}/Range.hpp
-  ${LIBPC_HEADERS_DIR}/Reader.hpp
+  ${LIBPC_HEADERS_DIR}/Producer.hpp
   ${LIBPC_HEADERS_DIR}/Schema.hpp
   ${LIBPC_HEADERS_DIR}/SchemaLayout.hpp
   ${LIBPC_HEADERS_DIR}/Signaller.hpp
@@ -81,7 +81,7 @@
   MosaicFilter.cpp
   Vector.cpp  
   PointData.cpp
-  Reader.cpp
+  Producer.cpp
   Schema.cpp
   SchemaLayout.cpp
   Signaller.cpp
diff -r 2db88a88b578 -r 52486659a751 src/FauxReader.cpp
--- a/src/FauxReader.cpp	Mon Mar 07 14:07:33 2011 -0600
+++ b/src/FauxReader.cpp	Mon Mar 07 14:37:14 2011 -0600
@@ -47,7 +47,7 @@
 {
 
 FauxReader::FauxReader(const Bounds<double>& bounds, int numPoints, Mode mode)
-    : Reader()
+    : Producer()
     , m_mode(mode)
 {
     Header* header = new Header;
@@ -67,7 +67,7 @@
 }
 
 FauxReader::FauxReader(const Bounds<double>& bounds, int numPoints, Mode mode, const std::vector<Dimension>& dimensions)
-    : Reader()
+    : Producer()
     , m_mode(mode)
 {
     Header* header = new Header;
diff -r 2db88a88b578 -r 52486659a751 src/LasReader.cpp
--- a/src/LasReader.cpp	Mon Mar 07 14:07:33 2011 -0600
+++ b/src/LasReader.cpp	Mon Mar 07 14:37:14 2011 -0600
@@ -41,7 +41,7 @@
 
 
 LasReader::LasReader(std::istream& istream)
-    : Reader()
+    : Producer()
     , m_istream(istream)
 {
     LasHeader* lasHeader = new LasHeader;
diff -r 2db88a88b578 -r 52486659a751 src/Producer.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Producer.cpp	Mon Mar 07 14:37:14 2011 -0600
@@ -0,0 +1,94 @@
+/******************************************************************************
+* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following
+* conditions are met:
+*
+*     * Redistributions of source code must retain the above copyright
+*       notice, this list of conditions and the following disclaimer.
+*     * Redistributions in binary form must reproduce the above copyright
+*       notice, this list of conditions and the following disclaimer in
+*       the documentation and/or other materials provided
+*       with the distribution.
+*     * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
+*       names of its contributors may be used to endorse or promote
+*       products derived from this software without specific prior
+*       written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+* OF SUCH DAMAGE.
+****************************************************************************/
+
+#include "libpc/Producer.hpp"
+
+namespace libpc
+{
+
+
+Producer::Producer()
+    : m_currentPointIndex(0)
+{
+    return;
+}
+
+
+void Producer::seekToPoint(boost::uint64_t pointNum)
+{
+    if (pointNum == getCurrentPointIndex())
+    {
+        return;


More information about the Liblas-commits mailing list