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

The PositionedContainer interface. More...

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

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

Public Member Functions

 PositionedContainerInterface ()
 
virtual ~PositionedContainerInterface ()
 
virtual size_t getSize () const =0
 the size More...
 
virtual void setSize (size_t size)
 
virtual void clear ()=0
 
virtual const std::shared_ptr< T > getObject (size_t objectIndex) const =0
 Retrieve an object from the container. More...
 
virtual std::shared_ptr< T > getObject (size_t objectIndex)=0
 Retrieve an object from the container. More...
 
virtual const T & object (size_t objectIndex) const =0
 Get a reference toward an object from the container. More...
 
virtual T & object (size_t objectIndex)=0
 Get a reference toward an object from the container. More...
 
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...
 
virtual Clonableclone () const=0
 

Detailed Description

template<class T>
class bpp::PositionedContainerInterface< 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 27 of file PositionedContainer.h.

Constructor & Destructor Documentation

◆ PositionedContainerInterface()

Definition at line 31 of file PositionedContainer.h.

◆ ~PositionedContainerInterface()

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

Definition at line 32 of file PositionedContainer.h.

Member Function Documentation

◆ clear()

◆ deleteObject()

template<class T >
virtual void bpp::PositionedContainerInterface< T >::deleteObject ( size_t  objectIndex)
pure virtual

◆ getObject() [1/2]

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

Retrieve an object from the container.

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

Implemented in bpp::VectorPositionedContainer< T >, bpp::VectorPositionedContainer< bpp::Site >, and bpp::VectorPositionedContainer< SiteType >.

◆ getObject() [2/2]

template<class T >
virtual std::shared_ptr<T> bpp::PositionedContainerInterface< T >::getObject ( size_t  objectIndex)
pure virtual

Retrieve an object from the container.

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

Implemented in bpp::VectorPositionedContainer< T >, bpp::VectorPositionedContainer< bpp::Site >, and bpp::VectorPositionedContainer< SiteType >.

◆ getSize()

◆ object() [1/2]

template<class T >
virtual const T& bpp::PositionedContainerInterface< T >::object ( size_t  objectIndex) const
pure virtual

Get a reference toward an object from the container.

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

Implemented in bpp::VectorPositionedContainer< T >, bpp::VectorPositionedContainer< bpp::Site >, and bpp::VectorPositionedContainer< SiteType >.

◆ object() [2/2]

template<class T >
virtual T& bpp::PositionedContainerInterface< T >::object ( size_t  objectIndex)
pure virtual

Get a reference toward an object from the container.

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

Implemented in bpp::VectorPositionedContainer< T >, bpp::VectorPositionedContainer< bpp::Site >, and bpp::VectorPositionedContainer< SiteType >.

◆ removeObject()

template<class T >
virtual std::shared_ptr<T> bpp::PositionedContainerInterface< T >::removeObject ( size_t  objectIndex)
pure 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< bpp::Site >, bpp::VectorPositionedContainer< SiteType >, bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.

◆ setSize()

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

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