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

The template PositionedNamedContainer class, that links position & name containers. More...

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

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

Public Member Functions

virtual ~PositionedNamedContainer ()
 
The Clonable interface.
virtual PositionedNamedContainer< T > * clone () const =0
 

Protected Member Functions

virtual void addObject (std::shared_ptr< T > object, size_t objectIndex, const std::string &name, bool check=false)=0
 
virtual void insertObject (std::shared_ptr< T > object, size_t objectIndex, const std::string &name)=0
 
virtual size_t getObjectPosition (const std::string &name) const =0
 Link between position & name. More...
 
virtual std::string getObjectName (size_t objectIndex) const =0
 

Private Member Functions

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. 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...
 
virtual const std::shared_ptr< T > getObject (const std::string &name) const =0
 Retrieve an object from the container. More...
 
virtual std::shared_ptr< T > getObject (const std::string &name)=0
 
virtual bool hasObject (const std::string &name) const =0
 Check if a object with a given name is present in the container. More...
 
virtual std::shared_ptr< T > removeObject (const std::string &name)=0
 Extract and remove a object from the container. More...
 
virtual void deleteObject (const std::string &name)=0
 Remove a object from the container. More...
 
virtual std::vector< std::string > getObjectNames () const =0
 Get all the names of the objects in the container. More...
 
virtual size_t getSize () const =0
 Get the number of objects in the container. More...
 
virtual void clear ()=0
 Delete all objects in the container. More...
 

Detailed Description

template<class T>
class bpp::PositionedNamedContainer< T >

The template PositionedNamedContainer class, that links position & name containers.

Definition at line 62 of file PositionedNamedContainer.h.

Constructor & Destructor Documentation

◆ ~PositionedNamedContainer()

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

Definition at line 77 of file PositionedNamedContainer.h.

Member Function Documentation

◆ addObject()

template<class T >
virtual void bpp::PositionedNamedContainer< T >::addObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name,
bool  check = false 
)
protectedpure virtual

◆ clear() [1/2]

◆ clear() [2/2]

◆ clone()

◆ deleteObject() [1/2]

template<class T >
virtual void bpp::NamedContainer< T >::deleteObject ( const std::string &  name)
protectedpure virtualinherited

Remove a object from the container.

Parameters
nameThe name of the object.

Implemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, bpp::VectorMappedContainer< ProbabilisticSequence >, and bpp::MappedNamedContainer< T >.

◆ deleteObject() [2/2]

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

◆ getObject() [1/4]

template<class T >
virtual const std::shared_ptr<T> bpp::NamedContainer< T >::getObject ( const std::string &  name) const
protectedpure virtualinherited

Retrieve an object from the container.

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

Implemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, bpp::VectorMappedContainer< ProbabilisticSequence >, and bpp::MappedNamedContainer< T >.

◆ getObject() [2/4]

template<class T >
virtual std::shared_ptr<T> bpp::NamedContainer< T >::getObject ( const std::string &  name)
protectedpure virtualinherited

◆ getObject() [3/4]

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

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() [4/4]

◆ getObjectName()

template<class T >
virtual std::string bpp::PositionedNamedContainer< T >::getObjectName ( size_t  objectIndex) const
protectedpure virtual

◆ getObjectNames()

template<class T >
virtual std::vector<std::string> bpp::NamedContainer< T >::getObjectNames ( ) const
protectedpure virtualinherited

Get all the names of the objects in the container.

Returns
A vector of strings with all object names.

Implemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, bpp::VectorMappedContainer< ProbabilisticSequence >, and bpp::MappedNamedContainer< T >.

◆ getObjectPosition()

template<class T >
virtual size_t bpp::PositionedNamedContainer< T >::getObjectPosition ( const std::string &  name) const
protectedpure virtual

◆ getSize() [1/2]

template<class T >
virtual size_t bpp::NamedContainer< T >::getSize ( ) const
pure virtualinherited

Get the number of objects in the container.

Returns
The number of objects in the container.

Implemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, bpp::VectorMappedContainer< ProbabilisticSequence >, and bpp::MappedNamedContainer< T >.

◆ getSize() [2/2]

◆ hasObject()

template<class T >
virtual bool bpp::NamedContainer< T >::hasObject ( const std::string &  name) const
protectedpure virtualinherited

Check if a object with a given name is present in the container.

Parameters
nameThe name of the object.
Returns
True if a object with the given name is present in the container.

Implemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, bpp::VectorMappedContainer< ProbabilisticSequence >, and bpp::MappedNamedContainer< T >.

◆ insertObject()

template<class T >
virtual void bpp::PositionedNamedContainer< T >::insertObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name 
)
protectedpure virtual

◆ removeObject() [1/2]

template<class T >
virtual std::shared_ptr<T> bpp::NamedContainer< T >::removeObject ( const std::string &  name)
protectedpure virtualinherited

Extract and remove a object from the container.

Parameters
nameThe name of the object.

Implemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< Sequence >, bpp::VectorMappedContainer< ProbabilisticSequence >, and bpp::MappedNamedContainer< T >.

◆ removeObject() [2/2]

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

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)
inlinevirtualinherited

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