ESA JPIP server  0.1
meta_data.h
Go to the documentation of this file.
1 #ifndef _JPEG2000_META_DATA_H_
2 #define _JPEG2000_META_DATA_H_
3 
4 
5 #include <vector>
6 #include "base.h"
8 
9 
10 namespace jpeg2000
11 {
12 
13  using namespace data;
14 
15 
21  class Metadata
22  {
23  public:
27  vector<FileSegment> meta_data;
28 
32  vector<PlaceHolder> place_holders;
33 
34 
39  {
40  }
41 
45  Metadata(const Metadata& info)
46  {
47  *this = info;
48  }
49 
50  template<typename T> T& SerializeWith(T& stream)
51  {
52  return (stream & meta_data & place_holders);
53  }
54 
58  Metadata& operator=(const Metadata& info)
59  {
60  base::copy(meta_data, info.meta_data);
61  base::copy(place_holders, info.place_holders);
62 
63  return *this;
64  }
65 
66  friend ostream& operator << (ostream &out, const Metadata &info)
67  {
68  out << endl << "Meta-data: ";
69 
70  for(vector<FileSegment>::const_iterator i = info.meta_data.begin(); i != info.meta_data.end(); i++)
71  out << *i << " ";
72 
73  out << endl << "Place Holders: ";
74 
75  for(vector<PlaceHolder>::const_iterator i = info.place_holders.begin(); i != info.place_holders.end(); i++)
76  out << *i << " ";
77 
78  return out;
79  }
80 
81  virtual ~Metadata()
82  {
83  }
84  };
85 
86 }
87 
88 
89 #endif /* _JPEG2000_META_DATA_H_ */
Metadata()
Empty constructor.
Definition: meta_data.h:38
static void copy(std::vector< T > &dest, const std::vector< T > &src)
Copies a vector.
Definition: base.h:30
virtual ~Metadata()
Definition: meta_data.h:81
Metadata & operator=(const Metadata &info)
Copy assignment.
Definition: meta_data.h:58
Metadata(const Metadata &info)
Copy constructor.
Definition: meta_data.h:45
vector< PlaceHolder > place_holders
Associated place-holders.
Definition: meta_data.h:32
vector< FileSegment > meta_data
File segments of all the meta-data blocks.
Definition: meta_data.h:27
Contains the indexing information associated to the meta-data of a JPEG2000 image file...
Definition: meta_data.h:21
T & SerializeWith(T &stream)
Definition: meta_data.h:50
ostream & operator<<(ostream &out, const Request &request)
Definition: request.cc:65