src/CSLModels.cpp
void CSLModel::AddMatchCriteria (const std::string& _type,
                                 const MatchCritTy& _matchCrit,
                                 int lnNr)
{
    // We cannot overwrite with a _different_ a/c ICAO type!
    if (!icaoType.empty() &&            // already defined
        icaoType != _type)              // but wanted something different now?
    {
        LOG_MSG(logWARN, WARN_DIFF_TYPE, lnNr,
                _type.c_str(), icaoType.c_str(), 
                modelName.c_str());
    }
    // set the ICAO aircraft type once and forever
    else if (icaoType.empty()) {
        icaoType = _type;
        doc8643 = & Doc8643Get(_type);
        related = RelatedGet(_type);
    }
    
    // See if we need to add the other match criterion
    // We try to keep as few and as specific match criteria as possible
    for (MatchCritTy& mc: vecMatchCrit)
        // can we merge the new with existing criteria?
        if (mc.merge(_matchCrit))
            return;

    // not merged: then add
    vecMatchCrit.push_back(_matchCrit);
}
// Set the a/c type model, which also fills `doc8643` and `related`, and add other match criteria
Set the a/c type model, which also fills `doc8643` and `related`, and add other match criteria
Set the a / c type model which also fills ` doc8643 ` and ` related ` and add other match criteria
void CSLModel::AddMatchCriteria (const std::string& _type,
                                 const MatchCritTy& _matchCrit,
                                 int lnNr)
{
    if (!icaoType.empty() &&            
        icaoType != _type)              
    {
        LOG_MSG(logWARN, WARN_DIFF_TYPE, lnNr,
                _type.c_str(), icaoType.c_str(), 
                modelName.c_str());
    }
    else if (icaoType.empty()) {
        icaoType = _type;
        doc8643 = & Doc8643Get(_type);
        related = RelatedGet(_type);
    }
    for (MatchCritTy& mc: vecMatchCrit)
        if (mc.merge(_matchCrit))
            return;
    vecMatchCrit.push_back(_matchCrit);
}
void CSLModel :: AddMatchCriteria ( const std :: string & _type , const MatchCritTy & _matchCrit , int lnNr ) { if ( ! icaoType . empty ( ) && icaoType != _type ) { LOG_MSG ( logWARN , WARN_DIFF_TYPE , lnNr , _type . c_str ( ) , icaoType . c_str ( ) , modelName . c_str ( ) ) ; } else if ( icaoType . empty ( ) ) { icaoType = _type ; doc8643 = & Doc8643Get ( _type ) ; related = RelatedGet ( _type ) ; } for ( MatchCritTy & mc : vecMatchCrit ) if ( mc . merge ( _matchCrit ) ) return ; vecMatchCrit . push_back ( _matchCrit ) ; }
Set the a/c type model, which also fills `doc8643` and `related`, and add other match criteria
Set the a / c type model which also fills ` doc8643 ` and ` related ` and add other match criteria
// We cannot overwrite with a _different_ a/c ICAO type! // already defined // but wanted something different now? // set the ICAO aircraft type once and forever // See if we need to add the other match criterion // We try to keep as few and as specific match criteria as possible // can we merge the new with existing criteria? // not merged: then add