Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace n1 { namespace n2 {
- /*---- ----*/
- template<class T, class C, class I>
- boost::optional<const T&> getObjByName( const std::string& name,
- const C* objCollection,
- const I* collection,
- const I* collectionRu )
- {
- const T* apbObj = nullptr;
- auto getnpByName = [&]( const NameIndex* nameIndex ) {
- if ( nameIndex == nullptr )
- return apbObj;
- auto npnamecount = nameIndex->count( name );
- if ( npnamecount > 0 ) {
- auto pos = nameIndex->find( name );
- apbObj = &objCollection->at( pos->second );
- }
- return apbObj;
- };
- std::map<TlgParser::Language, std::function<void()>> collectionFinders(
- { { TlgParser::Language::EN, [&]() { getnpByName( collection ); } },
- { TlgParser::Language::RU, [&]() { getnpByName( collectionRu ); } } } );
- auto lang = TlgParser::checkLanguage( name.c_str() );
- if ( collectionFinders.find( lang ) != collectionFinders.end() )
- collectionFinders[lang]();
- if ( apbObj == nullptr )
- return boost::none;
- else
- return *apbObj;
- }
- /*---- ----*/
- static const Common::AdvancedEnum<TlgParser::Language, QString> charsUp( { { "Unknown", TlgParser::Language::Unknown },
- { "A-Z", TlgParser::Language::EN },
- { "А-Я", TlgParser::Language::RU } } );
- *dynamic_cast<A::A*>( this ) = *dynamic_cast<const A::A*>( value );
- for ( auto&& state : kolektsia ) {
- PDEBUGVV( m_logName ) << wrapInColor( std::string( "[ " ) + ANIPBL::aniTypes.at( state.first ) + " : "
- + ( ( state.second ) ? " ok " : "fail" ) + std::string( " ]" ),
- ( state.second ) ? 32 : 31 );
- }
- bool res( nullptr != m_awNameIndex.get() && nullptr != m_awRuNameIndex.get() && nullptr != m_npNameIndex.get()
- && nullptr != m_npRuNameIndex.get() && nullptr != m_firIdIndex.get() && nullptr != m_firNameIndex.get()
- && nullptr != m_firRuNameIndex.get() );
- if ( nameIndex == nullptr )
- return apbObj;
- std::map<TlgParser::Language, std::function<void()>> collectionFinders(
- { { TlgParser::Language::EN, [&]() { getnpByName( collection ); } },
- { TlgParser::Language::RU, [&]() { getnpByName( collectionRu ); } } } );
- for ( const auto& code : airdromes->at( i ).codelat() ) {
- m_adNameIndex->emplace( code, i );
- }
- const NameIndex* ANIHandler::awNameIndex() const
- {
- switch ( expression ) {
- case 1: {
- /* code */
- break;
- }
- case 2:
- /* code */
- break;
- default:
- break;
- }
- return m_awNameIndex.get();
- }
- std::pair<std::unique_ptr<F15Content>, std::unique_ptr<FieldState>> F15Parser::parseField15( const TelegramField& field,
- int shift )
- {}
- Aircraft::Aircraft( const double stallSpeed_, const QString& synonym_, const QString& synonym_ru_ )
- {}
- f( aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa );
- f( aaaaaaaaaaaaaaaaaaaa,
- aaaaaaaaaaaaaaaaaaaa,
- aaaaaaaaaaaaaaaaaaaa,
- aaaaaaaaaaaaaaaaaaaa,
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa );
- if ( telegram.telegramType == TelegramType::PLN || telegram.telegramType == TelegramType::FPL
- || telegram.telegramType == TelegramType::SHR ) {}
- if ( telegram.telegramType == 1 || telegram.telegramType == 2 || telegram.telegramType == 3 ) {}
- template<class T>
- std::unique_ptr<T> to_unique( T* ptr )
- {
- return std::unique_ptr<T>( ptr );
- }
- (void)( std::string ( * )( const std::string&, const int ) ) wrapInColor;
- #define PWARNINGVVV( loggerName ) PWARNING_IF( value ) << "[VVV] "
- }} // namespace n1::n2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement