[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Dec 16 13:13:37 EST 2010


changeset b5a75a46bb36 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=b5a75a46bb36
summary: whoops

changeset 018aae9571f4 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=018aae9571f4
summary: now that they're pointer-to-body, make liblas::Writer and liblas::Reader copyable

diffstat:

 include/liblas/lasreader.hpp |  10 +++++-----
 include/liblas/laswriter.hpp |   9 ++++-----
 src/lasreader.cpp            |  14 ++++++++++++++
 src/lasspatialreference.cpp  |   1 -
 src/laswriter.cpp            |  15 +++++++++++++++
 5 files changed, 38 insertions(+), 11 deletions(-)

diffs (120 lines):

diff -r ff5fad2234df -r 018aae9571f4 include/liblas/lasreader.hpp
--- a/include/liblas/lasreader.hpp	Thu Dec 16 09:40:26 2010 -0600
+++ b/include/liblas/lasreader.hpp	Thu Dec 16 12:13:27 2010 -0600
@@ -74,7 +74,9 @@
     Reader(std::istream& ifs, boost::uint32_t cache_size);
     Reader(std::istream& ifs, boost::uint32_t cache_size, Header const& header);
     Reader(ReaderI* reader);
-    
+
+    Reader(Reader const& other);
+    Reader& operator=(Reader const& rhs);    
     
     /// User-defined consructor initializes reader with input stream and
     /// a header to override the values in the file
@@ -138,16 +140,14 @@
     void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
 
 
+
 private:
 
-    // Blocked copying operations, declared but not defined.
-    Reader(Reader const& other);
-    Reader& operator=(Reader const& rhs);
 
     void Init(); // throws on error
 
     typedef boost::shared_ptr<ReaderI> ReaderIPtr;
-    const ReaderIPtr m_pimpl;
+    ReaderIPtr m_pimpl;
 
 
 };
diff -r ff5fad2234df -r 018aae9571f4 include/liblas/laswriter.hpp
--- a/include/liblas/laswriter.hpp	Thu Dec 16 09:40:26 2010 -0600
+++ b/include/liblas/laswriter.hpp	Thu Dec 16 12:13:27 2010 -0600
@@ -70,6 +70,9 @@
     /// @exception std::runtime_error - on failure state of the input stream.
     Writer(std::ostream& ofs, Header const& header);
 
+    Writer(Writer const& other);
+    Writer& operator=(Writer const& rhs);    
+    
     /// Destructor does not close file attached to the output stream
     /// Header may be updated after writing operation completed, if necessary
     /// in order to maintain data consistency.
@@ -102,12 +105,8 @@
     
 private:
     
-    // Blocked copying operations, declared but not defined.
-    Writer(Writer const& other);
-    Writer& operator=(Writer const& rhs);
-    
     typedef boost::shared_ptr<WriterI> WriterIPtr;
-    const WriterIPtr m_pimpl;
+    WriterIPtr m_pimpl;
 
 };
 
diff -r ff5fad2234df -r 018aae9571f4 src/lasreader.cpp
--- a/src/lasreader.cpp	Thu Dec 16 09:40:26 2010 -0600
+++ b/src/lasreader.cpp	Thu Dec 16 12:13:27 2010 -0600
@@ -95,6 +95,20 @@
     m_pimpl->SetHeader(header);
 }
 
+Reader::Reader(Reader const& other) 
+    : m_pimpl(other.m_pimpl)
+{
+}
+
+Reader& Reader::operator=(Reader const& rhs)
+{
+    if (&rhs != this)
+    {
+        m_pimpl = rhs.m_pimpl;
+    }
+    return *this;
+}
+
 Reader::~Reader()
 {
 
diff -r ff5fad2234df -r 018aae9571f4 src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp	Thu Dec 16 09:40:26 2010 -0600
+++ b/src/lasspatialreference.cpp	Thu Dec 16 12:13:27 2010 -0600
@@ -88,7 +88,6 @@
 SpatialReference::SpatialReference()
     : m_gtiff(0)
     , m_tiff(0)
-    , m_wkt(0)
 {
     assert(0 == m_gtiff);
     assert(0 == m_tiff);
diff -r ff5fad2234df -r 018aae9571f4 src/laswriter.cpp
--- a/src/laswriter.cpp	Thu Dec 16 09:40:26 2010 -0600
+++ b/src/laswriter.cpp	Thu Dec 16 12:13:27 2010 -0600
@@ -61,6 +61,21 @@
     m_pimpl->WriteHeader();
 }
 
+
+Writer::Writer(Writer const& other) 
+    : m_pimpl(other.m_pimpl)
+{
+}
+
+Writer& Writer::operator=(Writer const& rhs)
+{
+    if (&rhs != this)
+    {
+        m_pimpl = rhs.m_pimpl;
+    }
+    return *this;
+}
+
 Writer::~Writer()
 {
 


More information about the Liblas-commits mailing list