NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
CIdMapperComposite Class Reference

Search Toolkit Book for CIdMapperComposite

IdMapper implementation combining multiple id mappers with the selected priorities. More...

#include <objtools/readers/idmapper.hpp>

+ Inheritance diagram for CIdMapperComposite:
+ Collaboration diagram for CIdMapperComposite:

Classes

struct  SNode
 

Public Types

enum  EPriority { kPriority_Default = 0 }
 Sub-mapper priority. More...
 
typedef int TPriority
 

Public Member Functions

 CIdMapperComposite (void)
 
void AddMapper (IIdMapper *mapper, TPriority priority=kPriority_Default, EOwnership ownership=eTakeOwnership)
 Add sub-mapper. More...
 
virtual CSeq_id_Handle Map (const CSeq_id_Handle &)
 Map a single given CSeq_id_Handle to another. More...
 
virtual CRef< CSeq_locMap (const CSeq_loc &loc)
 
- Public Member Functions inherited from CIdMapper
 CIdMapper (const std::string &strContext="", bool bInvert=false, ILineErrorListener *pErrors=0)
 Constructor specifying the mapping context, direction, and error handling. More...
 
virtual ~CIdMapper ()
 
virtual void AddMapping (const CSeq_id_Handle &from, const CSeq_id_Handle &to)
 Add a mapping to the internal mapping table. More...
 
virtual void AddMapping (const CSeq_loc &loc_from, const CSeq_loc &loc_to)
 
virtual void MapObject (CSerialObject &)
 Map all embedded IDs in a given object at once. More...
 
- Public Member Functions inherited from IIdMapper
virtual ~IIdMapper ()
 

Private Types

typedef CAtomicCounter::TValue TOrder
 
typedef set< SNodeTMappers
 

Private Attributes

TMappers m_Mappers
 

Additional Inherited Members

- Protected Types inherited from CIdMapper
typedef std::map< CSeq_id_Handle, SMapperTMapperCache
 
- Static Protected Member Functions inherited from CIdMapper
static std::string MapErrorString (const CSeq_id_Handle &)
 
static std::string MapErrorString (const CSeq_loc &)
 
- Protected Attributes inherited from CIdMapper
const std::string m_strContext
 
const bool m_bInvert
 
TMapperCache m_Cache
 
ILineErrorListenerm_pErrors
 

Detailed Description

IdMapper implementation combining multiple id mappers with the selected priorities.

Definition at line 126 of file idmapper.hpp.

Member Typedef Documentation

◆ TMappers

Definition at line 177 of file idmapper.hpp.

◆ TOrder

Definition at line 151 of file idmapper.hpp.

◆ TPriority

Definition at line 136 of file idmapper.hpp.

Member Enumeration Documentation

◆ EPriority

Sub-mapper priority.

Default is zero, positive values are for higher priorities. Mappers with the same priorities are checked in the order of their addition to the composite mapper.

Enumerator
kPriority_Default 

Definition at line 133 of file idmapper.hpp.

Constructor & Destructor Documentation

◆ CIdMapperComposite()

CIdMapperComposite::CIdMapperComposite ( void  )
inline

Definition at line 138 of file idmapper.hpp.

Member Function Documentation

◆ AddMapper()

void CIdMapperComposite::AddMapper ( IIdMapper mapper,
TPriority  priority = kPriority_Default,
EOwnership  ownership = eTakeOwnership 
)

Add sub-mapper.

By default the composite mapper owns the added object.

Definition at line 230 of file idmapper.cpp.

References set< Key, Compare >::insert(), and m_Mappers.

◆ Map() [1/2]

CSeq_id_Handle CIdMapperComposite::Map ( const CSeq_id_Handle id)
virtual

Map a single given CSeq_id_Handle to another.

Returns
the mapped handle, or an invalid handle if a mapping is not possible.

Reimplemented from CIdMapper.

Definition at line 238 of file idmapper.cpp.

References ITERATE, and m_Mappers.

◆ Map() [2/2]

CRef< CSeq_loc > CIdMapperComposite::Map ( const CSeq_loc loc)
virtual

Reimplemented from CIdMapper.

Definition at line 249 of file idmapper.cpp.

References ITERATE, and m_Mappers.

Member Data Documentation

◆ m_Mappers

TMappers CIdMapperComposite::m_Mappers
private

Definition at line 179 of file idmapper.hpp.

Referenced by AddMapper(), and Map().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:56 2024 by modify_doxy.py rev. 669887