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

Search Toolkit Book for CModHandler

#include <objtools/readers/mod_reader.hpp>

+ Collaboration diagram for CModHandler:

Public Types

enum  EHandleExisting { eReplace = 0 , ePreserve = 1 , eAppendReplace = 2 , eAppendPreserve = 3 }
using TModList = list< CModData >
using TMods = map< string, list< CModData > >
using TModEntry = TMods::value_type
using FReportError = function< void(const CModData &mod, const string &message, EDiagSev severity, EModSubcode subcode)>

Public Member Functions

 CModHandler ()
void SetExcludedMods (const vector< string > &excluded_mods)
void SetIgnoredMods (const list< string > &ignored_mods)
void AddMods (const TModList &mods, EHandleExisting handle_existing, TModList &rejected_mods, FReportError fReportError=nullptr)
void SetMods (const TMods &mods)
const TModsGetMods (void) const
void Clear (void)

Static Public Member Functions

static const stringGetCanonicalName (const TModEntry &mod_entry)
static const stringAssertReturnSingleValue (const TModEntry &mod_entry)
static string GetCanonicalName (const string &name)

Private Types

using TNameMap = unordered_map< string, string >
using TNameSet = unordered_set< string >

Private Member Functions

void x_SaveMods (TMods &&mods, EHandleExisting handle_existing, TMods &dest)

Static Private Member Functions

static string x_GetNormalizedString (const string &name)
static bool x_MultipleValuesAllowed (const string &canonical_name)
static bool x_IsDeprecated (const string &canonical_name)

Private Attributes

TMods m_Mods
TNameSet m_ExcludedModifiers
TNameSet m_IgnoredModifiers

Static Private Attributes

static const TNameMap sm_NameMap
static const TNameSet sm_MultipleValuesForbidden
static const TNameSet sm_DeprecatedModifiers

Detailed Description

Definition at line 90 of file mod_reader.hpp.

Member Typedef Documentation

◆ FReportError

using CModHandler::FReportError = function<void(const CModData& mod, const string& message, EDiagSev severity, EModSubcode subcode)>

Definition at line 105 of file mod_reader.hpp.

◆ TModEntry

Definition at line 104 of file mod_reader.hpp.

◆ TModList

Definition at line 94 of file mod_reader.hpp.

◆ TMods

Definition at line 103 of file mod_reader.hpp.

◆ TNameMap

using CModHandler::TNameMap = unordered_map<string, string>

Definition at line 134 of file mod_reader.hpp.

◆ TNameSet

using CModHandler::TNameSet = unordered_set<string>

Definition at line 135 of file mod_reader.hpp.

Member Enumeration Documentation

◆ EHandleExisting


Definition at line 96 of file mod_reader.hpp.

Constructor & Destructor Documentation

◆ CModHandler()

CModHandler::CModHandler ( )

Definition at line 195 of file mod_reader.cpp.

Member Function Documentation

◆ AddMods()

void CModHandler::AddMods ( const TModList mods,
EHandleExisting  handle_existing,
TModList rejected_mods,
FReportError  fReportError = nullptr 

◆ AssertReturnSingleValue()

const string & CModHandler::AssertReturnSingleValue ( const TModEntry mod_entry)

◆ Clear()

void CModHandler::Clear ( void  )

Definition at line 387 of file mod_reader.cpp.

References map_checker< Container >::clear(), and m_Mods.

Referenced by CFastaReader::x_AddMods().

◆ GetCanonicalName() [1/2]

string CModHandler::GetCanonicalName ( const string name)

Definition at line 405 of file mod_reader.cpp.

References s_ModNameMap, and x_GetNormalizedString().

◆ GetCanonicalName() [2/2]

const string & CModHandler::GetCanonicalName ( const TModEntry mod_entry)

◆ GetMods()

const CModHandler::TMods & CModHandler::GetMods ( void  ) const

Definition at line 381 of file mod_reader.cpp.

References m_Mods.

Referenced by CModAdder::Apply(), and g_ApplyMods().

◆ SetExcludedMods()

void CModHandler::SetExcludedMods ( const vector< string > &  excluded_mods)

Definition at line 198 of file mod_reader.cpp.

References m_ExcludedModifiers, and transform().

Referenced by CApplyMods::operator()(), and CFastaReader::SetExcludedMods().

◆ SetIgnoredMods()

void CModHandler::SetIgnoredMods ( const list< string > &  ignored_mods)

Definition at line 206 of file mod_reader.cpp.

References m_IgnoredModifiers, and transform().

Referenced by CFastaReader::SetIgnoredMods().

◆ SetMods()

void CModHandler::SetMods ( const TMods mods)

Definition at line 215 of file mod_reader.cpp.

References m_Mods.

Referenced by CApplyMods::operator()().

◆ x_GetNormalizedString()

string CModHandler::x_GetNormalizedString ( const string name)

Definition at line 444 of file mod_reader.cpp.

References s_GetNormalizedString().

Referenced by GetCanonicalName().

◆ x_IsDeprecated()

bool CModHandler::x_IsDeprecated ( const string canonical_name)

Definition at line 417 of file mod_reader.cpp.

References sm_DeprecatedModifiers.

Referenced by AddMods().

◆ x_MultipleValuesAllowed()

bool CModHandler::x_MultipleValuesAllowed ( const string canonical_name)

Definition at line 374 of file mod_reader.cpp.

References sm_MultipleValuesForbidden.

Referenced by AddMods(), and x_SaveMods().

◆ x_SaveMods()

void CModHandler::x_SaveMods ( TMods &&  mods,
EHandleExisting  handle_existing,
TMods dest 

Member Data Documentation

◆ m_ExcludedModifiers

TNameSet CModHandler::m_ExcludedModifiers

Definition at line 139 of file mod_reader.hpp.

Referenced by AddMods(), and SetExcludedMods().

◆ m_IgnoredModifiers

TNameSet CModHandler::m_IgnoredModifiers

Definition at line 140 of file mod_reader.hpp.

Referenced by AddMods(), and SetIgnoredMods().

◆ m_Mods

TMods CModHandler::m_Mods

Definition at line 132 of file mod_reader.hpp.

Referenced by AddMods(), Clear(), GetMods(), and SetMods().

◆ sm_DeprecatedModifiers

const CModHandler::TNameSet CModHandler::sm_DeprecatedModifiers
Initial value:

Definition at line 138 of file mod_reader.hpp.

Referenced by x_IsDeprecated().

◆ sm_MultipleValuesForbidden

const CModHandler::TNameSet CModHandler::sm_MultipleValuesForbidden
Initial value:

Definition at line 137 of file mod_reader.hpp.

Referenced by x_MultipleValuesAllowed().

◆ sm_NameMap

const TNameMap CModHandler::sm_NameMap

Definition at line 136 of file mod_reader.hpp.

The documentation for this class was generated from the following files:
Modified on Sun Jun 16 04:36:36 2024 by rev. 669887