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

The Locality class. More...

#include <Bpp/PopGen/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...
 

Protected Attributes

std::string name_
 

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 73 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 83 of file Locality.h.

◆ ~Locality()

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

Destroy a locality.

Definition at line 90 of file Locality.h.

Member Function Documentation

◆ clone()

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

Implements the Clonable interface.

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.

Referenced by 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.

◆ 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.

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: