[Liblas-commits] libpc: fix up missing invocation

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Mar 7 15:07:46 EST 2011


details:   http://hg.liblas.orglibpc/rev/655df2350573
changeset: 180:655df2350573
user:      Howard Butler <hobu.inc at gmail.com>
date:      Mon Mar 07 14:03:34 2011 -0600
description:
fix up missing invocation
Subject: libpc: rename libpc::Writer to libpc::Consumer

details:   http://hg.liblas.orglibpc/rev/2db88a88b578
changeset: 181:2db88a88b578
user:      Howard Butler <hobu.inc at gmail.com>
date:      Mon Mar 07 14:07:33 2011 -0600
description:
rename libpc::Writer to libpc::Consumer

diffstat:

 include/libpc/Consumer.hpp    |   86 ++++++++++++++++++++++++++++++++
 include/libpc/FauxWriter.hpp  |    4 +-
 include/libpc/LasWriter.hpp   |    4 +-
 include/libpc/Writer.hpp      |   86 --------------------------------
 src/CMakeLists.txt            |    4 +-
 src/Consumer.cpp              |  110 ++++++++++++++++++++++++++++++++++++++++++
 src/FauxWriter.cpp            |    2 +-
 src/LasWriter.cpp             |    2 +-
 src/Writer.cpp                |  110 ------------------------------------------
 src/drivers/liblas/writer.cpp |    2 +-
 src/drivers/liblas/writer.hpp |    4 +-
 src/drivers/oci/writer.cpp    |    6 +-
 src/drivers/oci/writer.hpp    |    4 +-
 13 files changed, 212 insertions(+), 212 deletions(-)

diffs (truncated from 563 to 300 lines):

diff -r f27440b0a58d -r 2db88a88b578 include/libpc/Consumer.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/Consumer.hpp	Mon Mar 07 14:07:33 2011 -0600
@@ -0,0 +1,86 @@
+/******************************************************************************
+* 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_CONSUMER_HPP
+#define INCLUDED_CONSUMER_HPP
+
+#include "libpc/Filter.hpp"
+
+namespace libpc
+{
+
+// a Writer is a Filter, because it has a previous stage and a header
+// however, Consumer generally do not implement the readNextPoints method
+class LIBPC_DLL Consumer : public Filter
+{
+public:
+    Consumer(Stage& prevStage);
+
+    // size of the PointData buffer to use
+    void setChunkSize(boost::uint32_t);
+    boost::uint32_t getChunkSize() const;
+
+    // Read the  given number of points (or less, if the reader runs out first), 
+    // and then write them out to wherever.  Returns total number of points
+    // actually written.
+    boost::uint64_t write(std::size_t targetNumPointsToWrite);
+
+protected:
+    // this is called once before the loop with the writeBuffer calls
+    virtual void writeBegin() = 0;
+
+    // called repeatedly, until out of data
+    virtual boost::uint32_t writeBuffer(const PointData&) = 0;
+
+    // called once, after the writeBuffer calls
+    virtual void writeEnd() = 0;
+
+    // not generally used in Writer objects
+    virtual boost::uint32_t readBuffer(PointData&);
+
+    // these two are valid for use after writeBegin has been called
+    std::size_t m_actualNumPointsWritten;
+    std::size_t m_targetNumPointsToWrite;
+
+private:
+    boost::uint32_t m_chunkSize;
+    static const boost::uint32_t s_defaultChunkSize;
+
+    Consumer& operator=(const Consumer&); // not implemented
+    Consumer(const Consumer&); // not implemented
+};
+
+} // namespace libpc
+
+#endif
diff -r f27440b0a58d -r 2db88a88b578 include/libpc/FauxWriter.hpp
--- a/include/libpc/FauxWriter.hpp	Mon Mar 07 13:46:28 2011 -0600
+++ b/include/libpc/FauxWriter.hpp	Mon Mar 07 14:07:33 2011 -0600
@@ -37,7 +37,7 @@
 
 #include <string>
 
-#include "libpc/Writer.hpp"
+#include "libpc/Consumer.hpp"
 
 namespace libpc
 {
@@ -48,7 +48,7 @@
 //
 // This writer knows only about three dimensions: X,Y,Z (as floats).
 //
-class LIBPC_DLL FauxWriter : public Writer
+class LIBPC_DLL FauxWriter : public Consumer
 {
 public:
     FauxWriter(Stage& prevStage);
diff -r f27440b0a58d -r 2db88a88b578 include/libpc/LasWriter.hpp
--- a/include/libpc/LasWriter.hpp	Mon Mar 07 13:46:28 2011 -0600
+++ b/include/libpc/LasWriter.hpp	Mon Mar 07 14:07:33 2011 -0600
@@ -35,12 +35,12 @@
 #ifndef INCLUDED_LASWRITER_HPP
 #define INCLUDED_LASWRITER_HPP
 
-#include "libpc/Writer.hpp"
+#include "libpc/Consumer.hpp"
 
 namespace libpc
 {
 
-class LIBPC_DLL LasWriter : public Writer
+class LIBPC_DLL LasWriter : public Consumer
 {
 public:
     LasWriter(Stage& prevStage, std::ostream&);
diff -r f27440b0a58d -r 2db88a88b578 include/libpc/Writer.hpp
--- a/include/libpc/Writer.hpp	Mon Mar 07 13:46:28 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +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_WRITER_HPP
-#define INCLUDED_WRITER_HPP
-
-#include "libpc/Filter.hpp"
-
-namespace libpc
-{
-
-// a Writer is a Filter, because it has a previous stage and a header
-// however, Writers generally do not implement the readNextPoints method
-class LIBPC_DLL Writer : public Filter
-{
-public:
-    Writer(Stage& prevStage);
-
-    // size of the PointData buffer to use
-    void setChunkSize(boost::uint32_t);
-    boost::uint32_t getChunkSize() const;
-
-    // Read the  given number of points (or less, if the reader runs out first), 
-    // and then write them out to wherever.  Returns total number of points
-    // actually written.
-    boost::uint64_t write(std::size_t targetNumPointsToWrite);
-
-protected:
-    // this is called once before the loop with the writeBuffer calls
-    virtual void writeBegin() = 0;
-
-    // called repeatedly, until out of data
-    virtual boost::uint32_t writeBuffer(const PointData&) = 0;
-
-    // called once, after the writeBuffer calls
-    virtual void writeEnd() = 0;
-
-    // not generally used in Writer objects
-    virtual boost::uint32_t readBuffer(PointData&);
-
-    // these two are valid for use after writeBegin has been called
-    std::size_t m_actualNumPointsWritten;
-    std::size_t m_targetNumPointsToWrite;
-
-private:
-    boost::uint32_t m_chunkSize;
-    static const boost::uint32_t s_defaultChunkSize;
-
-    Writer& operator=(const Writer&); // not implemented
-    Writer(const Writer&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r f27440b0a58d -r 2db88a88b578 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Mon Mar 07 13:46:28 2011 -0600
+++ b/src/CMakeLists.txt	Mon Mar 07 14:07:33 2011 -0600
@@ -51,7 +51,7 @@
   ${LIBPC_HEADERS_DIR}/SpatialReference.hpp
   ${LIBPC_HEADERS_DIR}/Stage.hpp
   ${LIBPC_HEADERS_DIR}/Utils.hpp
-  ${LIBPC_HEADERS_DIR}/Writer.hpp)
+  ${LIBPC_HEADERS_DIR}/Consumer.hpp)
 
 set (LIBPC_SOURCES "libpc_config.cpp" CACHE INTERNAL "sources to compile")
 set (APPS_CPP_DEPENDENCIES "${LIBPC_LIB_NAME}" CACHE INTERNAL "libraries to link")
@@ -88,7 +88,7 @@
   SpatialReference.cpp
   Stage.cpp
   Utils.cpp
-  Writer.cpp)
+  Consumer.cpp)
 
 
 # Group source files for IDE source explorers (e.g. Visual Studio)
diff -r f27440b0a58d -r 2db88a88b578 src/Consumer.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Consumer.cpp	Mon Mar 07 14:07:33 2011 -0600
@@ -0,0 +1,110 @@
+/******************************************************************************
+* 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 <cassert>
+
+#include "libpc/exceptions.hpp"
+#include "libpc/Consumer.hpp"
+
+namespace libpc
+{
+
+const boost::uint32_t Consumer::s_defaultChunkSize = 1024 * 32;
+
+
+Consumer::Consumer(Stage& prevStage)
+    : Filter(prevStage)
+    , m_actualNumPointsWritten(0)
+    , m_targetNumPointsToWrite(0)
+    , m_chunkSize(s_defaultChunkSize)
+{
+    return;
+}
+
+
+void Consumer::setChunkSize(boost::uint32_t chunkSize)


More information about the Liblas-commits mailing list