Jpp  18.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
JLANG::JEquals< JFirst_t, JSecond_t > JDETECTOR::JDetectorHeader JDETECTOR::JDetector JDETECTOR::JMonteCarloDetector JDYNAMICS::JDynamics

Public Member Functions

 JUTMGrid ()
 Default constructor. More...
 
 JUTMGrid (const std::string &key, const std::string &wgs, const std::string &zone)
 Constructor. More...
 
const JUTMGridgetUTMGrid () const
 Get UTM grid. More...
 
void setUTMGrid (const JUTMGrid &grid)
 Set UTM grid. More...
 
const std::stringgetKey () const
 Get key. More...
 
const std::stringgetWGS () const
 Get WGS. More...
 
const std::stringgetUTMZone () const
 Get UTM zone. More...
 
int getUTMValue () const
 Get UTM zone by numerical value. More...
 
bool equals (const JUTMGrid &grid) const
 Check equality. 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 37 of file JUTMGrid.hh.

Constructor & Destructor Documentation

JUTM::JUTMGrid::JUTMGrid ( )
inline

Default constructor.

Definition at line 44 of file JUTMGrid.hh.

44  :
45  key ("?"),
46  wgs ("?"),
47  zone("?")
48  {}
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247
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 58 of file JUTMGrid.hh.

61  {
62  this->key = key;
63  this->wgs = wgs;
64  this->zone = zone;
65  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247

Member Function Documentation

const JUTMGrid& JUTM::JUTMGrid::getUTMGrid ( ) const
inline

Get UTM grid.

Returns
UTM grid

Definition at line 73 of file JUTMGrid.hh.

74  {
75  return static_cast<const JUTMGrid&>(*this);
76  }
Data structure for UTM grid.
Definition: JUTMGrid.hh:37
void JUTM::JUTMGrid::setUTMGrid ( const JUTMGrid grid)
inline

Set UTM grid.

Parameters
gridUTM grid

Definition at line 84 of file JUTMGrid.hh.

85  {
86  static_cast<JUTMGrid&>(*this) = grid;
87  }
Data structure for UTM grid.
Definition: JUTMGrid.hh:37
const std::string& JUTM::JUTMGrid::getKey ( ) const
inline

Get key.

Returns
key

Definition at line 95 of file JUTMGrid.hh.

96  {
97  return key;
98  }
std::string key
Definition: JUTMGrid.hh:246
const std::string& JUTM::JUTMGrid::getWGS ( ) const
inline

Get WGS.

Returns
WGS

Definition at line 106 of file JUTMGrid.hh.

107  {
108  return wgs;
109  }
std::string wgs
Definition: JUTMGrid.hh:247
const std::string& JUTM::JUTMGrid::getUTMZone ( ) const
inline

Get UTM zone.

Returns
UTM zone

Definition at line 117 of file JUTMGrid.hh.

118  {
119  return zone;
120  }
std::string zone
Definition: JUTMGrid.hh:248
int JUTM::JUTMGrid::getUTMValue ( ) const
inline

Get UTM zone by numerical value.

Returns
UTM zone

Definition at line 128 of file JUTMGrid.hh.

129  {
130  using namespace std;
131 
132  int value = 0;
133 
134  for (string::const_iterator i = zone.begin(); i != zone.end(); ++i) {
135  if (isdigit(*i))
136  value = 10 * value + (*i - '0');
137  else
138  break;
139  }
140 
141  return value;
142  }
std::string zone
Definition: JUTMGrid.hh:248
bool JUTM::JUTMGrid::equals ( const JUTMGrid grid) const
inline

Check equality.

Parameters
gridUTM grid
Returns
true if grids are equal; else false

Definition at line 151 of file JUTMGrid.hh.

152  {
153  return (this->getKey() == grid.getKey() &&
154  this->getWGS() == grid.getWGS() &&
155  this->getUTMValue() == grid.getUTMValue());
156  }
int getUTMValue() const
Get UTM zone by numerical value.
Definition: JUTMGrid.hh:128
const std::string & getWGS() const
Get WGS.
Definition: JUTMGrid.hh:106
const std::string & getKey() const
Get key.
Definition: JUTMGrid.hh:95
std::string JUTM::JUTMGrid::toString ( ) const
inline

Convert UTM grid.

Returns
UTM grid

Definition at line 164 of file JUTMGrid.hh.

165  {
166  return (key + " " + wgs + " " + zone);
167  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247
static JUTMGrid JUTM::JUTMGrid::valueOf ( const std::string buffer)
inlinestatic

Extract UTM grid.

Parameters
bufferWGS and UTM zone
Returns
UTM grid

Definition at line 176 of file JUTMGrid.hh.

177  {
178  JUTMGrid grid;
179 
180  std::istringstream is(buffer);
181 
182  if (is >> grid)
183  return grid;
184  else
185  throw JParseError("JUTMGrid::valueOf()");
186  }
is
Definition: JDAQCHSM.chsm:167
Data structure for UTM grid.
Definition: JUTMGrid.hh:37

Friends And Related Function Documentation

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 196 of file JUTMGrid.hh.

197  {
198  return in >> grid.key >> grid.wgs >> grid.zone;
199  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
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 209 of file JUTMGrid.hh.

210  {
211  return out << grid.key << ' ' << grid.wgs << ' ' << grid.zone;
212  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247
JReader& operator>> ( JReader in,
JUTMGrid grid 
)
friend

Read UTM grid from input.

Parameters
ininput stream
gridUTM grid
Returns
input stream

Definition at line 222 of file JUTMGrid.hh.

223  {
224  using namespace JIO;
225 
226  return in >> grid.key >> grid.wgs >> grid.zone;
227  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247
JWriter& operator<< ( JWriter out,
const JUTMGrid grid 
)
friend

Write UTM grid to output.

Parameters
outoutput stream
gridUTM grid
Returns
output stream

Definition at line 237 of file JUTMGrid.hh.

238  {
239  using namespace JIO;
240 
241  return out << grid.key << grid.wgs << grid.zone;
242  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247

Member Data Documentation

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

Definition at line 246 of file JUTMGrid.hh.

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

Definition at line 247 of file JUTMGrid.hh.

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

Definition at line 248 of file JUTMGrid.hh.


The documentation for this class was generated from the following file: