bpp-seq3
3.0.0
|
MappedNamedContainer class. More...
#include <Bpp/Seq/Container/MappedNamedContainer.h>
Public Member Functions | |
MappedNamedContainer () | |
MappedNamedContainer (const std::map< std::string, std::shared_ptr< T >> &ms) | |
MappedNamedContainer (const MappedNamedContainer &msc) | |
virtual | ~MappedNamedContainer () |
MappedNamedContainer & | operator= (const MappedNamedContainer &msc) |
const std::shared_ptr< T > | getObject (const std::string &name) const override |
Retrieve an object from the container. More... | |
std::shared_ptr< T > | getObject (const std::string &name) override |
const T & | object (const std::string &name) const override |
T & | object (const std::string &name) override |
bool | hasObject (const std::string &name) const override |
Check if a object with a given name is present in the container. More... | |
void | addObject (std::shared_ptr< T > newObject, const std::string &name, bool checkName=false) |
Set an object. More... | |
void | deleteObject (const std::string &name) override |
Remove an object. More... | |
std::shared_ptr< T > | removeObject (const std::string &name) override |
Remove and returns an object. More... | |
virtual std::vector< std::string > | getObjectNames () const override |
void | changeName (const std::string &okey, const std::string &nkey) |
change the key of an object. More... | |
size_t | getSize () const override |
Get the number of objects in the container. More... | |
void | clear () override |
Delete all objects in the container. More... | |
bool | isAvailableName (std::string objectName) const |
void | addObject_ (std::shared_ptr< T > newObject, const std::string &name, bool checkName=false) const |
virtual void | nullify () |
Nullify all elements. More... | |
The clonable interface | |
MappedNamedContainer * | clone () const override |
Private Attributes | |
std::map< std::string, std::shared_ptr< T > > | mObjects_ |
MappedNamedContainer class.
Objects are stored using a key std::string, in a map object.
Definition at line 24 of file MappedNamedContainer.h.
|
inline |
Definition at line 31 of file MappedNamedContainer.h.
Referenced by bpp::MappedNamedContainer< T >::clone().
|
inline |
Definition at line 35 of file MappedNamedContainer.h.
|
inline |
Definition at line 39 of file MappedNamedContainer.h.
|
inlinevirtual |
Definition at line 43 of file MappedNamedContainer.h.
|
inline |
Set an object.
name | The key of the object. |
newObject | The new object that will be associated to the key. |
checkName | Tell is the object name must be checked. |
Definition at line 110 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::addObject(), bpp::VectorMappedContainer< T >::appendObject(), and bpp::VectorMappedContainer< T >::insertObject().
|
inline |
Definition at line 200 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::addObject_().
|
inline |
change the key of an object.
okey | The present key of the object. |
nkey | The next key of the object. |
Definition at line 168 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::setObjectName(), and bpp::VectorMappedContainer< T >::setObjectNames().
|
inlineoverridevirtual |
Delete all objects in the container.
Implements bpp::NamedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 186 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::clear().
|
inlineoverridevirtual |
Implements bpp::Clonable.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 50 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::MappedNamedContainer().
|
inlineoverridevirtual |
Remove an object.
name | The key of the object. |
Implements bpp::NamedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 123 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::deleteObject().
|
inlineoverridevirtual |
Retrieve an object from the container.
name | The name of the object. |
Implements bpp::NamedContainerInterface< T >.
Definition at line 61 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::MappedNamedContainer< T >::isAvailableName(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequence(), and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::sequence().
|
inlineoverridevirtual |
Implements bpp::NamedContainerInterface< T >.
Definition at line 70 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
|
inlineoverridevirtual |
Implements bpp::NamedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 150 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
|
inlineoverridevirtual |
Get the number of objects in the container.
Implements bpp::NamedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 184 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::getNumberOfObjects().
|
inlineoverridevirtual |
Check if a object with a given name is present in the container.
name | The name of the object. |
Implements bpp::NamedContainerInterface< T >.
Definition at line 97 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::MappedNamedContainer< T >::addObject(), bpp::MappedNamedContainer< T >::addObject_(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::addSequence(), bpp::MappedNamedContainer< T >::changeName(), bpp::MappedNamedContainer< T >::deleteObject(), bpp::TemplateVectorSequenceContainer< SequenceType >::hasSequence(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::hasSequence(), bpp::MappedNamedContainer< T >::isAvailableName(), and bpp::MappedNamedContainer< T >::removeObject().
|
inline |
Definition at line 195 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::getObject(), and bpp::MappedNamedContainer< T >::hasObject().
Referenced by bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::sequence().
|
inlinevirtual |
Nullify all elements.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 212 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::nullify().
|
inlineoverridevirtual |
Implements bpp::NamedContainerInterface< T >.
Definition at line 79 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::TemplateVectorSequenceContainer< SequenceType >::sequence_().
|
inlineoverridevirtual |
Implements bpp::NamedContainerInterface< T >.
Definition at line 88 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
|
inline |
Definition at line 54 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::operator=().
|
inlineoverridevirtual |
Remove and returns an object.
name | The key of the object. |
Implements bpp::NamedContainerInterface< T >.
Reimplemented in bpp::VectorMappedContainer< T >, bpp::VectorMappedContainer< bpp::Sequence >, and bpp::VectorMappedContainer< SequenceType >.
Definition at line 137 of file MappedNamedContainer.h.
References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.
Referenced by bpp::VectorMappedContainer< T >::removeObject().
|
private |
Definition at line 28 of file MappedNamedContainer.h.
Referenced by bpp::MappedNamedContainer< T >::addObject(), bpp::MappedNamedContainer< T >::addObject_(), bpp::MappedNamedContainer< T >::changeName(), bpp::MappedNamedContainer< T >::clear(), bpp::MappedNamedContainer< T >::deleteObject(), bpp::MappedNamedContainer< T >::getObject(), bpp::MappedNamedContainer< T >::getObjectNames(), bpp::MappedNamedContainer< T >::getSize(), bpp::MappedNamedContainer< T >::hasObject(), bpp::MappedNamedContainer< T >::nullify(), bpp::MappedNamedContainer< T >::object(), bpp::MappedNamedContainer< T >::operator=(), and bpp::MappedNamedContainer< T >::removeObject().