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

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

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

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

Public Member Functions

virtual ~PositionedNamedContainerInterface ()
 
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 const std::string & getObjectName (size_t objectIndex) const =0
 
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 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...
 
The Clonable interface.
virtual PositionedNamedContainerInterface< T > * clone () const =0
 

Protected Member Functions

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 const T & object (const std::string &name) const =0
 
virtual T & object (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...
 

Detailed Description

template<class T>
class bpp::PositionedNamedContainerInterface< T >

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

This interface also includes addObject and insertObject methods.

Definition at line 26 of file PositionedNamedContainer.h.

Constructor & Destructor Documentation

◆ ~PositionedNamedContainerInterface()

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

Definition at line 40 of file PositionedNamedContainer.h.

Member Function Documentation

◆ addObject()

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

◆ clear() [1/2]

template<class T >
virtual void bpp::NamedContainerInterface< T >::clear ( )
pure virtualinherited

◆ clear() [2/2]

◆ clone()

◆ deleteObject() [1/2]

template<class T >
virtual void bpp::NamedContainerInterface< 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< bpp::Sequence >, bpp::VectorMappedContainer< SequenceType >, and bpp::MappedNamedContainer< T >.

◆ deleteObject() [2/2]

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

◆ getObject() [1/4]

template<class T >
virtual const std::shared_ptr<T> bpp::NamedContainerInterface< 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::MappedNamedContainer< T >.

◆ getObject() [2/4]

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

◆ getObject() [3/4]

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

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

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

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

◆ getObjectName()

template<class T >
virtual const std::string& bpp::PositionedNamedContainerInterface< T >::getObjectName ( size_t  objectIndex) const
pure virtual

◆ getObjectNames()

template<class T >
virtual std::vector<std::string> bpp::NamedContainerInterface< 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< bpp::Sequence >, bpp::VectorMappedContainer< SequenceType >, and bpp::MappedNamedContainer< T >.

◆ getObjectPosition()

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

◆ getSize() [1/2]

template<class T >
virtual size_t bpp::NamedContainerInterface< 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< bpp::Sequence >, bpp::VectorMappedContainer< SequenceType >, and bpp::MappedNamedContainer< T >.

◆ getSize() [2/2]

◆ hasObject()

template<class T >
virtual bool bpp::NamedContainerInterface< 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::MappedNamedContainer< T >.

◆ insertObject()

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

◆ object() [1/4]

template<class T >
virtual const T& bpp::NamedContainerInterface< T >::object ( const std::string &  name) const
protectedpure virtualinherited

◆ object() [2/4]

template<class T >
virtual T& bpp::NamedContainerInterface< T >::object ( const std::string &  name)
protectedpure virtualinherited

◆ object() [3/4]

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

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

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

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

template<class T >
virtual std::shared_ptr<T> bpp::NamedContainerInterface< 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< bpp::Sequence >, bpp::VectorMappedContainer< SequenceType >, and bpp::MappedNamedContainer< T >.

◆ removeObject() [2/2]

template<class T >
virtual std::shared_ptr<T> bpp::PositionedContainerInterface< T >::removeObject ( size_t  objectIndex)
pure 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< 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)
inlinevirtualinherited

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