bpp-popgen  3.0.0
bpp::Locality< T > Class Template Reference

The Locality class. More...

#include <Bpp/PopGen/DataSet/Locality.h>

+ Inheritance diagram for bpp::Locality< T >:
+ Collaboration diagram for bpp::Locality< T >:

Public Member Functions

 Locality (const std::string name, const T x=0, const T y=0)
 Build a new locality with name and coordinates. More...
 
 Locality (const std::string name, const bpp::Point2D< T > &coord)
 Build a new locality with name and coordinates. More...
 
virtual ~Locality ()
 Destroy a locality. More...
 
Locality< T > * clone () const
 Implements the Clonable interface. More...
 
virtual bool operator== (const Locality< T > &locality) const
 The == operator. More...
 
virtual bool operator!= (const Locality< T > &locality) const
 The != operator. More...
 
void setName (const std::string &name)
 Set the name of the locality. More...
 
const std::string & getName () const
 Get the name of the locality. More...
 
void setCoord (const T x, const T y)
 
void setX (const T x)
 
void setY (const T y)
 
const T & getX () const
 
const T & getY () const
 
bool hasSameCoordsAs (const Point2D< T > &coord) const
 
virtual bool operator== (const Point2D< T > &coord) const
 
virtual bool operator!= (const Point2D< T > &coord) const
 

Protected Attributes

std::string name_
 

Private Attributes

x_
 
y_
 

Detailed Description

template<class T>
class bpp::Locality< T >

The Locality class.

This is a class derivated from the Point2D class. It's a Point2D with a name.

Author
Sylvain Gaillard

Definition at line 58 of file Locality.h.

Constructor & Destructor Documentation

◆ Locality() [1/2]

template<class T >
bpp::Locality< T >::Locality ( const std::string  name,
const T  x = 0,
const T  y = 0 
)
inline

Build a new locality with name and coordinates.

Parameters
nameThe name of the locality.
xThe longitude.
yThe latitude.

Definition at line 62 of file Locality.h.

◆ Locality() [2/2]

template<class T >
bpp::Locality< T >::Locality ( const std::string  name,
const bpp::Point2D< T > &  coord 
)
inline

Build a new locality with name and coordinates.

Parameters
nameThe name of the locality.
coordThe coordinates of the locality.

Definition at line 62 of file Locality.h.

◆ ~Locality()

template<class T >
virtual bpp::Locality< T >::~Locality ( )
inlinevirtual

Destroy a locality.

Definition at line 62 of file Locality.h.

Member Function Documentation

◆ clone()

template<class T >
Locality<T>* bpp::Locality< T >::clone ( ) const
inlinevirtual

Implements the Clonable interface.

Implements bpp::Clonable.

Definition at line 97 of file Locality.h.

◆ getName()

template<class T >
const std::string& bpp::Locality< T >::getName ( ) const
inline

Get the name of the locality.

Definition at line 125 of file Locality.h.

References bpp::Locality< T >::name_.

Referenced by bpp::DataSet::addLocality(), bpp::PopgenlibIO::parseLocality_(), and bpp::PopgenlibIO::write().

◆ operator!=()

template<class T >
virtual bool bpp::Locality< T >::operator!= ( const Locality< T > &  locality) const
inlinevirtual

The != operator.

Definition at line 112 of file Locality.h.

◆ operator==()

template<class T >
virtual bool bpp::Locality< T >::operator== ( const Locality< T > &  locality) const
inlinevirtual

The == operator.

returns true if both name and coordinates are identical between the two Locality objects.

Definition at line 104 of file Locality.h.

References bpp::Point2D< class >::getX(), bpp::Point2D< T >::getX(), bpp::Point2D< class >::getY(), bpp::Point2D< T >::getY(), and bpp::Locality< T >::name_.

◆ setName()

template<class T >
void bpp::Locality< T >::setName ( const std::string &  name)
inline

Set the name of the locality.

Definition at line 120 of file Locality.h.

References bpp::Locality< T >::name_.

Referenced by bpp::PopgenlibIO::parseLocality_().

Member Data Documentation

◆ name_

template<class T >
std::string bpp::Locality< T >::name_
protected

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