libpniio
ifd.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2011 DESY, Eugen Wintersberger <eugen.wintersberger@desy.de>
3 //
4 // This file is part of libpniio.
5 //
6 // libpniio is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // libpniio is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with libpniio. If not, see <http://www.gnu.org/licenses/>.
18 // ===========================================================================
19 //
20 // Created on: Jun 16, 2011
21 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
22 //
23 //
24 #pragma once
25 
26 #include <memory>
27 #include <vector>
28 #include <fstream>
29 #include <iostream>
30 
31 #include <pni/core/types.hpp>
32 
33 #include "ifd_entry.hpp"
34 
35 namespace pni{
36 namespace io{
37 namespace tiff{
38 
39 
57  class ifd
58  {
59  protected:
60  std::vector<ifd_entry> _entries;
61  public:
62  //===============public data types=================================
63  //some data types that can be useful for IFDs
65  typedef std::vector<ifd_entry>::iterator iterator;
67  typedef std::vector<ifd_entry>::const_iterator const_iterator;
68 
69  //==================constructors and destructor====================
71  ifd();
72 
73  //-----------------------------------------------------------------
75  ifd(const ifd &o);
76 
77  //-----------------------------------------------------------------
89  explicit ifd(size_t size);
90 
91  //-----------------------------------------------------------------
93  ifd(ifd &&o);
94 
95  //-----------------------------------------------------------------
97  ~ifd();
98 
99  //===================assignment operator===========================
101  ifd &operator = (const ifd &o);
102 
103  //-----------------------------------------------------------------
105  ifd &operator = (ifd &&o);
106 
107  //====================public member methods========================
114  size_t size() const { return _entries.size(); }
115 
116  //-----------------------------------------------------------------
128  ifd_entry operator[](size_t i) const;
129 
130  //-----------------------------------------------------------------
141  ifd_entry operator[](const string &n) const;
142 
143  //-----------------------------------------------------------------
151  iterator begin() { return _entries.begin(); }
152 
153  //-----------------------------------------------------------------
161  iterator end() { return _entries.end(); }
162 
163  //-----------------------------------------------------------------
170  const_iterator begin() const { return _entries.begin(); }
171 
172  //-----------------------------------------------------------------
179  const_iterator end() const { return _entries.end(); }
180 
181  //-----------------------------------------------------------------
192  friend std::ostream &operator<<(std::ostream &o,const ifd &image_dir);
193  };
194 
195 
196 //end of namespace
197 }
198 }
199 }
std::vector< ifd_entry >::iterator iterator
iterator over IDF entries in IDFList
Definition: ifd.hpp:65
iterator end()
get last iterator
Definition: ifd.hpp:161
ifd_entry operator[](size_t i) const
operator to obtain an entry by index
Definition: ifd.cpp:87
size_t size() const
get number of IFD entries
Definition: ifd.hpp:114
friend std::ostream & operator<<(std::ostream &o, const ifd &image_dir)
overloaded ostream operator for standard output
Definition: ifd.cpp:107
ifd & operator=(const ifd &o)
copy assignment operator
Definition: ifd.cpp:69
Definition: cbf_reader.hpp:41
class for IFD entries
Definition: ifd_entry.hpp:72
const_iterator begin() const
get const first iterator
Definition: ifd.hpp:170
~ifd()
destructor
Definition: ifd.cpp:62
std::vector< ifd_entry >::const_iterator const_iterator
const. iterator over IDF entries in IDF List
Definition: ifd.hpp:67
IFD - Image File Directory class.
Definition: ifd.hpp:57
const_iterator end() const
get const last iterator
Definition: ifd.hpp:179
ifd()
default constructor
Definition: ifd.cpp:38
std::vector< ifd_entry > _entries
list of IFD entries
Definition: ifd.hpp:60
iterator begin()
get first iterator
Definition: ifd.hpp:151