bpp-popgen  2.1.0
 All Classes Namespaces Files Functions Variables Friends Pages
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...
 
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_
 

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

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.

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.

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

Destroy a locality.

Definition at line 90 of file Locality.h.

Member Function Documentation

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

Implements the Clonable interface.

Reimplemented from bpp::Point2D< T >.

Definition at line 97 of file Locality.h.

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().

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.

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.

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


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