Jpp
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
JUTM::JUTMGrid Class Reference

Data structure for UTM grid. More...

#include <JUTMGrid.hh>

Inheritance diagram for JUTM::JUTMGrid:
JDETECTOR::JDetectorHeader JDETECTOR::JDetector JDETECTOR::JMonteCarloDetector

Public Member Functions

 JUTMGrid ()
 Default constructor. More...
 
 JUTMGrid (const std::string &key, const std::string &wgs, const std::string &zone)
 Constructor. More...
 
const std::string & getKey () const
 Get key. More...
 
const std::string & getWGS () const
 Get WGS. More...
 
const std::string & getUTMZone () const
 Get UTM zone. More...
 
std::string toString () const
 Convert UTM grid. More...
 

Static Public Member Functions

static JUTMGrid valueOf (const std::string &buffer)
 Extract UTM grid. More...
 

Protected Attributes

std::string key
 
std::string wgs
 
std::string zone
 

Friends

std::istream & operator>> (std::istream &in, JUTMGrid &grid)
 Read UTM grid from input. More...
 
std::ostream & operator<< (std::ostream &out, const JUTMGrid &grid)
 Write UTM grid to output. More...
 
JReaderoperator>> (JReader &in, JUTMGrid &grid)
 Read UTM grid from input. More...
 
JWriteroperator<< (JWriter &out, const JUTMGrid &grid)
 Write UTM grid to output. More...
 

Detailed Description

Data structure for UTM grid.

This data structure is composed of:

Definition at line 34 of file JUTMGrid.hh.

Constructor & Destructor Documentation

◆ JUTMGrid() [1/2]

JUTM::JUTMGrid::JUTMGrid ( )
inline

Default constructor.

Definition at line 39 of file JUTMGrid.hh.

39  :
40  key ("?"),
41  wgs ("?"),
42  zone("?")
43  {}

◆ JUTMGrid() [2/2]

JUTM::JUTMGrid::JUTMGrid ( const std::string &  key,
const std::string &  wgs,
const std::string &  zone 
)
inline

Constructor.

Parameters
keykey
wgsWGS
zoneUTM zone

Definition at line 53 of file JUTMGrid.hh.

56  {
57  this->key = key;
58  this->wgs = wgs;
59  this->zone = zone;
60  }

Member Function Documentation

◆ getKey()

const std::string& JUTM::JUTMGrid::getKey ( ) const
inline

Get key.

Returns
key

Definition at line 68 of file JUTMGrid.hh.

69  {
70  return key;
71  }

◆ getWGS()

const std::string& JUTM::JUTMGrid::getWGS ( ) const
inline

Get WGS.

Returns
WGS

Definition at line 79 of file JUTMGrid.hh.

80  {
81  return wgs;
82  }

◆ getUTMZone()

const std::string& JUTM::JUTMGrid::getUTMZone ( ) const
inline

Get UTM zone.

Returns
UTM zone

Definition at line 90 of file JUTMGrid.hh.

91  {
92  return zone;
93  }

◆ toString()

std::string JUTM::JUTMGrid::toString ( ) const
inline

Convert UTM grid.

Returns
UTM grid

Definition at line 101 of file JUTMGrid.hh.

102  {
103  return (key + " " + wgs + " " + zone);
104  }

◆ valueOf()

static JUTMGrid JUTM::JUTMGrid::valueOf ( const std::string &  buffer)
inlinestatic

Extract UTM grid.

Parameters
bufferWGS and UTM zone
Returns
UTM grid

Definition at line 113 of file JUTMGrid.hh.

114  {
115  JUTMGrid grid;
116 
117  std::istringstream is(buffer);
118 
119  if (is >> grid)
120  return grid;
121  else
122  throw JParseError("JUTMGrid::valueOf()");
123  }

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JUTMGrid grid 
)
friend

Read UTM grid from input.

Parameters
ininput stream
gridUTM grid
Returns
input stream

Definition at line 133 of file JUTMGrid.hh.

134  {
135  return in >> grid.key >> grid.wgs >> grid.zone;
136  }

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const JUTMGrid grid 
)
friend

Write UTM grid to output.

Parameters
outoutput stream
gridUTM grid
Returns
output stream

Definition at line 146 of file JUTMGrid.hh.

147  {
148  return out << grid.key << ' ' << grid.wgs << ' ' << grid.zone;
149  }

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JUTMGrid grid 
)
friend

Read UTM grid from input.

Parameters
ininput stream
gridUTM grid
Returns
input stream

Definition at line 159 of file JUTMGrid.hh.

160  {
161  using namespace JIO;
162 
163  return in >> grid.key >> grid.wgs >> grid.zone;
164  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JUTMGrid grid 
)
friend

Write UTM grid to output.

Parameters
outoutput stream
gridUTM grid
Returns
output stream

Definition at line 174 of file JUTMGrid.hh.

175  {
176  using namespace JIO;
177 
178  return out << grid.key << grid.wgs << grid.zone;
179  }

Member Data Documentation

◆ key

std::string JUTM::JUTMGrid::key
protected

Definition at line 183 of file JUTMGrid.hh.

◆ wgs

std::string JUTM::JUTMGrid::wgs
protected

Definition at line 184 of file JUTMGrid.hh.

◆ zone

std::string JUTM::JUTMGrid::zone
protected

Definition at line 185 of file JUTMGrid.hh.


The documentation for this class was generated from the following file:
JUTM::JUTMGrid
Data structure for UTM grid.
Definition: JUTMGrid.hh:34
JUTM::JUTMGrid::key
std::string key
Definition: JUTMGrid.hh:183
JUTM::JUTMGrid::wgs
std::string wgs
Definition: JUTMGrid.hh:184
JUTM::JUTMGrid::zone
std::string zone
Definition: JUTMGrid.hh:185
JIO
Auxiliary classes and methods for binary I/O.
Definition: JBinaryFileReader.hh:17