bpp-seq3
3.0.0
|
The template VectorPositionedContainer class. More...
#include <Bpp/Seq/Container/VectorPositionedContainer.h>
Public Member Functions | |
VectorPositionedContainer (const std::vector< std::shared_ptr< T >> &vs) | |
Build a new container from a set of positions. More... | |
VectorPositionedContainer (size_t size=0) | |
Build a new empty container with specified size. More... | |
VectorPositionedContainer (const VectorPositionedContainer< T > &vsc) | |
VectorPositionedContainer< T > & | operator= (const VectorPositionedContainer< T > &vsc) |
copy where shared_ptr elements are shared More... | |
virtual | ~VectorPositionedContainer () |
size_t | getSize () const override |
the size More... | |
bool | isAvailablePosition (size_t objectIndex) const |
bool | hasObjectWithPosition (size_t objectIndex) const |
void | setSize (size_t size) override |
void | clear () override |
Destroys the vector. More... | |
virtual void | nullify () |
Nullify all elements. More... | |
const std::shared_ptr< T > | getObject (size_t objectIndex) const override |
Retrieve an object from the container. More... | |
std::shared_ptr< T > | getObject (size_t objectIndex) override |
Retrieve an object from the container. More... | |
const T & | object (size_t objectIndex) const override |
Get a reference toward an object from the container. More... | |
T & | object (size_t objectIndex) override |
Get a reference toward an object from the container. More... | |
void | addObject (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false) |
Add an object. More... | |
void | insertObject (std::shared_ptr< T > object, size_t objectIndex) |
Insert an object. More... | |
std::shared_ptr< T > | removeObject (size_t objectIndex) override |
Extract and remove a object from the container. More... | |
void | deleteObject (size_t objectIndex) override |
Delete an object from the container. More... | |
void | deleteObjects (size_t objectIndex, size_t length) |
void | appendObject (std::shared_ptr< T > object) |
std::shared_ptr< T > | getObject_ (size_t objectIndex) const |
void | addObject_ (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false) const |
The Clonable interface. | |
VectorPositionedContainer< T > * | clone () const override |
Protected Attributes | |
std::vector< std::shared_ptr< T > > | positions_ |
The template VectorPositionedContainer class.
Objects are stored in a std::vector of shared pointers. Object access is hence in .
Definition at line 29 of file VectorPositionedContainer.h.
|
inline |
Build a new container from a set of positions.
vs | A std::vector of objects. |
Definition at line 42 of file VectorPositionedContainer.h.
|
inline |
Build a new empty container with specified size.
size | Number of sequences in the container. |
Definition at line 51 of file VectorPositionedContainer.h.
|
inline |
Definition at line 56 of file VectorPositionedContainer.h.
|
inlinevirtual |
Definition at line 69 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
|
inline |
Add an object.
object | The object to add. |
objectIndex | The new position of the object |
checkPosition | Look if the position is empty. |
Definition at line 162 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), bpp::VectorPositionedContainer< T >::object(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorMappedContainer< T >::addObject(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSite(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::setSite(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::valueAt().
|
inline |
Definition at line 228 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorMappedContainer< T >::addObject_(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::site().
|
inline |
Definition at line 216 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSite(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::addSite(), and bpp::VectorMappedContainer< T >::appendObject().
|
inlineoverridevirtual |
Destroys the vector.
Implements bpp::PositionedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 113 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::clear(), bpp::VectorMappedContainer< T >::clear(), and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::clear().
|
inlineoverridevirtual |
Implements bpp::Clonable.
Reimplemented in bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 80 of file VectorPositionedContainer.h.
|
inlineoverridevirtual |
Delete an object from the container.
objectIndex | The index of the object in the container. |
Implements bpp::PositionedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 200 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorMappedContainer< T >::deleteObject(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::deleteSite(), and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::deleteSite().
|
inline |
Definition at line 208 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::deleteSites(), and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::deleteSites().
|
inlineoverridevirtual |
Retrieve an object from the container.
objectIndex | The position of the object. |
Implements bpp::PositionedContainerInterface< T >.
Definition at line 127 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::site(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::site(), and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::site_().
|
inlineoverridevirtual |
Retrieve an object from the container.
objectIndex | The position of the object. |
Implements bpp::PositionedContainerInterface< T >.
Definition at line 134 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
|
inline |
Definition at line 221 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
|
inlineoverridevirtual |
the size
Implements bpp::PositionedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 87 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorPositionedContainer< T >::addObject(), bpp::VectorPositionedContainer< T >::deleteObject(), bpp::VectorPositionedContainer< T >::deleteObjects(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::getNumberOfSites(), bpp::VectorPositionedContainer< T >::getObject(), bpp::VectorMappedContainer< T >::getSize(), bpp::VectorPositionedContainer< T >::hasObjectWithPosition(), bpp::VectorPositionedContainer< T >::insertObject(), bpp::VectorPositionedContainer< T >::isAvailablePosition(), bpp::VectorPositionedContainer< T >::object(), and bpp::VectorPositionedContainer< T >::removeObject().
|
inline |
Definition at line 97 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::site().
|
inline |
Insert an object.
object | The object to add. |
objectIndex | The new position of the object |
Definition at line 179 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSite(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::addSite(), and bpp::VectorMappedContainer< T >::insertObject().
|
inline |
Definition at line 92 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
|
inlinevirtual |
Nullify all elements.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 122 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::insertSequence(), bpp::VectorMappedContainer< T >::nullify(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::operator=(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSequence().
|
inlineoverridevirtual |
Get a reference toward an object from the container.
objectIndex | The position of the object. |
Implements bpp::PositionedContainerInterface< T >.
Definition at line 141 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorPositionedContainer< T >::addObject().
|
inlineoverridevirtual |
Get a reference toward an object from the container.
objectIndex | The position of the object. |
Implements bpp::PositionedContainerInterface< T >.
Definition at line 148 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
|
inline |
copy where shared_ptr elements are shared
Definition at line 63 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorMappedContainer< T >::operator=().
|
inlineoverridevirtual |
Extract and remove a object from the container.
objectIndex | The position of the object. |
Implements bpp::PositionedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 188 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::VectorMappedContainer< T >::removeObject(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::removeSite(), and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::removeSite().
|
inlineoverridevirtual |
Reimplemented from bpp::PositionedContainerInterface< T >.
Definition at line 102 of file VectorPositionedContainer.h.
References bpp::VectorPositionedContainer< T >::positions_.
Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSequence(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::operator=(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer().
|
protected |
Definition at line 34 of file VectorPositionedContainer.h.
Referenced by bpp::VectorPositionedContainer< T >::addObject(), bpp::VectorPositionedContainer< T >::addObject_(), bpp::VectorPositionedContainer< T >::appendObject(), bpp::VectorPositionedContainer< T >::clear(), bpp::VectorPositionedContainer< T >::deleteObject(), bpp::VectorPositionedContainer< T >::deleteObjects(), bpp::VectorPositionedContainer< T >::getObject(), bpp::VectorPositionedContainer< T >::getObject_(), bpp::VectorPositionedContainer< T >::getSize(), bpp::VectorPositionedContainer< T >::hasObjectWithPosition(), bpp::VectorPositionedContainer< T >::insertObject(), bpp::VectorPositionedContainer< T >::isAvailablePosition(), bpp::VectorPositionedContainer< T >::nullify(), bpp::VectorPositionedContainer< T >::object(), bpp::VectorPositionedContainer< T >::operator=(), bpp::VectorPositionedContainer< T >::removeObject(), bpp::VectorPositionedContainer< T >::setSize(), and bpp::VectorPositionedContainer< T >::~VectorPositionedContainer().