libLAS API Reference (svn-trunk)
factory.hpp
Go to the documentation of this file.
1/******************************************************************************
2* $Id$
3*
4* Project: libLAS - http://liblas.org - A BSD library for LAS format data.
5* Purpose: LAS factories
6* Author: Howard Butler, hobu.inc@gmail.com
7*
8******************************************************************************
9* Copyright (c) 2008, Mateusz Loskot
10* Copyright (c) 2010, Howard Butler
11*
12* All rights reserved.
13*
14* Redistribution and use in source and binary forms, with or without
15* modification, are permitted provided that the following
16* conditions are met:
17*
18* * Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* * Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided
23* with the distribution.
24* * Neither the name of the Martin Isenburg or Iowa Department
25* of Natural Resources nor the names of its contributors may be
26* used to endorse or promote products derived from this software
27* without specific prior written permission.
28*
29* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
32* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
33* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
34* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
35* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
36* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
37* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
40* OF SUCH DAMAGE.
41****************************************************************************/
42
43#ifndef LIBLAS_FACTORY_HPP_INCLUDED
44#define LIBLAS_FACTORY_HPP_INCLUDED
45
46#include <liblas/reader.hpp>
47#include <liblas/writer.hpp>
48#include <liblas/export.hpp>
49
50
51namespace liblas {
52
53
55{
56public:
57
58
60
63
64 Reader CreateWithImpl(ReaderIPtr r);
65
66 Reader CreateCached(std::istream& stream, uint32_t cache_size);
67 Reader CreateWithStream(std::istream& stream);
68
69 // help function to create an input stream
70 // returns NULL if failed to open
71 // static std::istream* FileOpen(std::string const& filename, std::ios::openmode mode);
72 // static void FileClose(std::istream*);
73
77
78
79private:
80
81};
82
84{
85public:
92
94
97
98 Writer CreateWithImpl(WriterIPtr w);
99
100 // makes a WriterImpl or a ZipWriterImpl, depending on header type
101 static WriterIPtr CreateWithStream(std::ostream& stream, Header const& header);
102
106
107 // returns Unknown, unless we find a .laz or .las extension
108 static FileType InferFileTypeFromExtension(const std::string&);
109
110//
111private:
112
113};
114} // namespace liblas
115
116#endif // ndef LIBLAS_FACTORY_HPP_INCLUDED
Definition of public header block.
Definition header.hpp:79
Reader CreateCached(std::istream &stream, uint32_t cache_size)
ReaderFactory(ReaderFactory const &other)
ReaderFactory & operator=(ReaderFactory const &rhs)
ReaderFactory()
Definition factory.hpp:59
~ReaderFactory()
Destructor.
Definition factory.hpp:76
Reader CreateWithStream(std::istream &stream)
Reader CreateWithImpl(ReaderIPtr r)
Defines public interface to LAS reader implementation.
Definition reader.hpp:67
~WriterFactory()
Destructor.
Definition factory.hpp:105
static FileType InferFileTypeFromExtension(const std::string &)
Writer CreateWithImpl(WriterIPtr w)
static WriterIPtr CreateWithStream(std::ostream &stream, Header const &header)
FileType
Definition factory.hpp:87
@ FileType_LAS
Definition factory.hpp:89
@ FileType_LAZ
Definition factory.hpp:90
@ FileType_Unknown
Definition factory.hpp:88
WriterFactory(WriterFactory const &other)
WriterFactory()
Definition factory.hpp:93
WriterFactory & operator=(WriterFactory const &rhs)
Defines public interface to LAS writer implementation.
Definition writer.hpp:64
#define LAS_DLL
Definition export.hpp:58
Namespace grouping all elements of libLAS public interface.
Definition bounds.hpp:60