SwathsByCells.h
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 #pragma once
8 #ifndef FIELDS2COVER_TYPES_SWATHS_BY_CELLS_H_
9 #define FIELDS2COVER_TYPES_SWATHS_BY_CELLS_H_
10 
11 #include <vector>
14 
15 namespace f2c::types {
16 
17 struct SwathsByCells {
18  SwathsByCells();
19  explicit SwathsByCells(int i);
20  explicit SwathsByCells(const std::initializer_list<Swaths>& s);
21  explicit SwathsByCells(const std::vector<Swaths>& s);
23 
24  void emplace_back(const Swaths& s);
25  void push_back(const Swaths& s);
26 
27  std::vector<Swaths>::iterator begin();
28  std::vector<Swaths>::iterator end();
29  std::vector<Swaths>::const_iterator begin() const;
30  std::vector<Swaths>::const_iterator end() const;
31  void reverse();
32 
33  Swaths& back();
34  const Swaths& back() const;
35 
36  Swaths& at(size_t i);
37  const Swaths& at(size_t i) const;
38 
39  // Return the swath i^th
40  Swath& getSwath(size_t i);
41  const Swath& getSwath(size_t i) const;
42 
43  size_t size() const;
44 
45  // Sum of the size of each Swaths.
46  size_t sizeTotal() const;
47 
48  Swaths& operator[] (int i);
49  const Swaths& operator[] (int i) const;
50 
51  SwathsByCells clone() const;
52  Swaths flatten() const;
53 
54  private:
55  std::vector<Swaths> data_;
56 };
57 
58 
59 } // namespace f2c::types
60 
61 #endif // FIELDS2COVER_TYPES_SWATHS_BY_CELLS_H_
f2c::types::SwathsByCells::begin
std::vector< Swaths >::iterator begin()
Definition: SwathsByCells.cpp:38
f2c::types
Types used by fields2cover library.
Definition: Cell.h:20
f2c::types::SwathsByCells::back
Swaths & back()
Definition: SwathsByCells.cpp:58
f2c::types::SwathsByCells::at
Swaths & at(size_t i)
Definition: SwathsByCells.cpp:66
f2c::types::SwathsByCells::flatten
Swaths flatten() const
Definition: SwathsByCells.cpp:122
Swaths.h
f2c::types::SwathsByCells::push_back
void push_back(const Swaths &s)
Definition: SwathsByCells.cpp:34
f2c::types::Swath
Definition: Swath.h:23
f2c::types::SwathsByCells::sizeTotal
size_t sizeTotal() const
Definition: SwathsByCells.cpp:100
Swath.h
f2c::types::SwathsByCells::reverse
void reverse()
Definition: SwathsByCells.cpp:54
f2c::types::SwathsByCells::SwathsByCells
SwathsByCells()
f2c::types::SwathsByCells::getSwath
Swath & getSwath(size_t i)
Definition: SwathsByCells.cpp:74
f2c::types::SwathsByCells::~SwathsByCells
~SwathsByCells()
f2c::types::SwathsByCells::operator[]
Swaths & operator[](int i)
Definition: SwathsByCells.cpp:106
f2c::types::SwathsByCells::data_
std::vector< Swaths > data_
Definition: SwathsByCells.h:55
f2c::types::SwathsByCells::size
size_t size() const
Definition: SwathsByCells.cpp:96
f2c::types::SwathsByCells::end
std::vector< Swaths >::iterator end()
Definition: SwathsByCells.cpp:42
f2c::types::SwathsByCells
Definition: SwathsByCells.h:17
f2c::types::SwathsByCells::emplace_back
void emplace_back(const Swaths &s)
Definition: SwathsByCells.cpp:30
f2c::types::Swaths
Definition: Swaths.h:20
f2c::types::SwathsByCells::clone
SwathsByCells clone() const
Definition: SwathsByCells.cpp:114


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31