bpp-seq3  3.0.0
bpp::PositionedContainer< T > Class Template Referenceabstract

The PositionedContainer interface. More...

#include <Bpp/Seq/Container/PositionedContainer.h>

+ Inheritance diagram for bpp::PositionedContainer< T >:

Public Member Functions

 PositionedContainer ()
 
virtual ~PositionedContainer ()
 
virtual size_t getSize () const =0
 the size More...
 
virtual void setSize (size_t size)
 
virtual void clear ()=0
 

Protected Member Functions

virtual const std::shared_ptr< T > getObject (size_t objectIndex) const =0
 Retrieve an object from the container. Set as protected since they will be public under T specific names. More...
 
virtual std::shared_ptr< T > getObject (size_t objectIndex)=0
 
virtual std::shared_ptr< T > removeObject (size_t objectIndex)=0
 Extract and remove a object from the container. More...
 
virtual void deleteObject (size_t objectIndex)=0
 Delete an object from the container. More...
 

Detailed Description

template<class T>
class bpp::PositionedContainer< T >

The PositionedContainer interface.

Interface to manage indexed containers, where Objects may be accessed via their indice, i.e. their position in the container.

All Objects must have a position, accessible through getPosition and setPosition methods (see Site class).

Definition at line 62 of file PositionedContainer.h.

Constructor & Destructor Documentation

◆ PositionedContainer()

template<class T >
bpp::PositionedContainer< T >::PositionedContainer ( )
inline

Definition at line 65 of file PositionedContainer.h.

◆ ~PositionedContainer()

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

Definition at line 66 of file PositionedContainer.h.

Member Function Documentation

◆ clear()

◆ deleteObject()

template<class T >
virtual void bpp::PositionedContainer< T >::deleteObject ( size_t  objectIndex)
protectedpure virtual

◆ getObject() [1/2]

template<class T >
virtual const std::shared_ptr<T> bpp::PositionedContainer< T >::getObject ( size_t  objectIndex) const
protectedpure virtual

Retrieve an object from the container. Set as protected since they will be public under T specific names.

Parameters
objectIndexThe position of the object.
Returns
A reference toward the Object object with corresponding name.

Implemented in bpp::VectorPositionedContainer< T >, bpp::VectorPositionedContainer< ProbabilisticSite >, bpp::VectorPositionedContainer< Site >, bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, and bpp::VectorMappedContainer< ProbabilisticSequence >.

◆ getObject() [2/2]

◆ getSize()

◆ removeObject()

template<class T >
virtual std::shared_ptr<T> bpp::PositionedContainer< T >::removeObject ( size_t  objectIndex)
protectedpure virtual

Extract and remove a object from the container.

Parameters
objectIndexThe position of the object.
Returns
A smart pointer toward the removed object.

Implemented in bpp::VectorPositionedContainer< T >, bpp::VectorPositionedContainer< ProbabilisticSite >, bpp::VectorPositionedContainer< Site >, bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, and bpp::VectorMappedContainer< ProbabilisticSequence >.

◆ setSize()

template<class T >
virtual void bpp::PositionedContainer< T >::setSize ( size_t  size)
inlinevirtual

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