|
NCBI C++ ToolKit
|
00001 /* $Id: speedtest.cpp 52500 2012-01-03 14:10:38Z ludwigf $ 00002 * =========================================================================== 00003 * 00004 * PUBLIC DOMAIN NOTICE 00005 * National Center for Biotechnology Information 00006 * 00007 * This software/database is a "United States Government Work" under the 00008 * terms of the United States Copyright Act. It was written as part of 00009 * the author's official duties as a United States Government employee and 00010 * thus cannot be copyrighted. This software/database is freely available 00011 * to the public for use. The National Library of Medicine and the U.S. 00012 * Government have not placed any restriction on its use or reproduction. 00013 * 00014 * Although all reasonable efforts have been taken to ensure the accuracy 00015 * and reliability of the software and data, the NLM and the U.S. 00016 * Government do not and cannot warrant the performance or results that 00017 * may be obtained by using this software or data. The NLM and the U.S. 00018 * Government disclaim all warranties, express or implied, including 00019 * warranties of performance, merchantability or fitness for any particular 00020 * purpose. 00021 * 00022 * Please cite the author in any work or product based on this material. 00023 * 00024 * =========================================================================== 00025 * 00026 * Author: Jonathan Kans, NCBI 00027 * Frank Ludwig, NCBI 00028 * 00029 * File Description: 00030 * C++ toolkit profiling module 00031 * 00032 * =========================================================================== 00033 */ 00034 00035 #include <ncbi_pch.hpp> 00036 #include <corelib/ncbiapp.hpp> 00037 #include <corelib/ncbienv.hpp> 00038 #include <corelib/ncbiargs.hpp> 00039 #include <corelib/ncbistl.hpp> 00040 #include <corelib/ncbitime.hpp> 00041 00042 #include <serial/iterator.hpp> 00043 #include <serial/objistr.hpp> 00044 #include <serial/objostr.hpp> 00045 #include <serial/serial.hpp> 00046 00047 #include <objects/seq/Bioseq.hpp> 00048 #include <objects/seqloc/Seq_id.hpp> 00049 #include <objects/seqset/Seq_entry.hpp> 00050 #include <objects/seqfeat/Seq_feat.hpp> 00051 #include <objects/submit/Seq_submit.hpp> 00052 00053 #include <objmgr/object_manager.hpp> 00054 #include <objmgr/scope.hpp> 00055 #include <objmgr/bioseq_ci.hpp> 00056 #include <objmgr/util/sequence.hpp> 00057 #include <objtools/cleanup/cleanup.hpp> 00058 #include <algo/align/prosplign/prosplign.hpp> 00059 00060 USING_NCBI_SCOPE; 00061 USING_SCOPE(objects); 00062 USING_SCOPE(sequence); 00063 00064 ///////////////////////////////////////////////////////////////////////////// 00065 00066 00067 class CMytestApplication : public CNcbiApplication 00068 { 00069 private: 00070 virtual void Init(void); 00071 virtual int Run(void); 00072 virtual void Exit(void); 00073 00074 void DoProcess ( CNcbiIstream& ip, CNcbiOstream& op, CScope&, CRef<CSeq_entry>& se ); 00075 00076 void DoProcessStreamFasta ( 00077 CNcbiIstream& ip, CNcbiOstream& op, CRef<CSeq_entry>& se ); 00078 void DoProcessStreamDefline ( 00079 CNcbiIstream& ip, CNcbiOstream& op, CRef<CSeq_entry>& se, CScope&i ); 00080 int DoProcessFeatureSuggest( 00081 CNcbiIstream&, CNcbiOstream&, CScope&, CRef<CSeq_entry>&, bool do_format ); 00082 00083 int DoProcessFeatureGeneOverlap( CNcbiIstream&, CNcbiOstream&, CScope&, CRef<CSeq_entry>&, bool do_format ); 00084 int TestFeatureGeneOverlap( CNcbiIstream&, CNcbiOstream&, CScope&, CBioseq&, bool do_format ); 00085 int TestFeatureGeneOverlap( CNcbiIstream&, CNcbiOstream&, CScope&, CSeq_annot&, bool do_format ); 00086 int TestFeatureGeneOverlap( CNcbiIstream&, CNcbiOstream&, CScope&, CSeq_feat&, bool do_format ); 00087 00088 int PlayAroundWithSuggestIntervals( CNcbiIstream&, CNcbiOstream&, CScope&, CRef<CSeq_entry>& ); 00089 void DumpAlignment( CNcbiOstream&, CRef<CSeq_align>& ); 00090 00091 void GetSeqEntry( CNcbiIstream&, CRef<CSeq_entry>& se ); 00092 00093 // data 00094 bool m_bsec; 00095 bool m_ssec; 00096 00097 bool m_fidx; 00098 00099 bool m_fasta; 00100 bool m_nodef; 00101 bool m_featfa; 00102 bool m_transl; 00103 bool m_svisit; 00104 bool m_ostream; 00105 00106 bool m_fvisit; 00107 bool m_goverlap; 00108 bool m_hoverlap; 00109 bool m_gxref; 00110 bool m_ooverlap; 00111 00112 bool m_defline_only; 00113 bool m_no_scope; 00114 bool m_suggest; 00115 }; 00116 00117 00118 ///////////////////////////////////////////////////////////////////////////// 00119 00120 00121 void CMytestApplication::Init(void) 00122 { 00123 // Create command-line argument descriptions class 00124 auto_ptr<CArgDescriptions> arg_desc(new CArgDescriptions); 00125 00126 // Specify USAGE context 00127 arg_desc->SetUsageContext 00128 (GetArguments().GetProgramBasename(), 00129 "C++ speed test program"); 00130 00131 arg_desc->AddKey 00132 ("i", "InputFile", 00133 "Input File Name", 00134 CArgDescriptions::eInputFile); 00135 00136 arg_desc->AddDefaultKey 00137 ("o", "OutputFile", 00138 "Output File Name", 00139 CArgDescriptions::eOutputFile, "-"); 00140 00141 arg_desc->AddDefaultKey 00142 ("a", "ASN1Type", 00143 "ASN.1 Type", 00144 CArgDescriptions::eString, "a"); 00145 arg_desc->SetConstraint 00146 ("a", &(*new CArgAllow_Strings, "a", "e", "b", "s", "m", "t", "l")); 00147 00148 arg_desc->AddDefaultKey 00149 ("X", "Repetitions", 00150 "Max Repeat Count", 00151 CArgDescriptions::eInteger, "1"); 00152 00153 arg_desc->AddOptionalKey 00154 ("K", "Cleanup", 00155 "b Basic, s Serious", 00156 CArgDescriptions::eString); 00157 arg_desc->SetConstraint 00158 ("K", &(*new CArgAllow_Strings, "b", "s")); 00159 00160 arg_desc->AddOptionalKey 00161 ("I", "Indexing", 00162 "f Feature Indexing", 00163 CArgDescriptions::eString); 00164 arg_desc->SetConstraint 00165 ("I", &(*new CArgAllow_Strings, "f")); 00166 00167 arg_desc->AddOptionalKey 00168 ("S", "Sequence", 00169 "s FASTA, S FASTA(no_scope mode), r No Defline, d Defline only, D Defline only(no_scope mode), " 00170 "f By Feature, t Translation, v Visit, o Ostream", 00171 CArgDescriptions::eString); 00172 arg_desc->SetConstraint 00173 ("S", &(*new CArgAllow_Strings, "S", "s", "r", "D", "d", "f", "t", "v", "o")); 00174 00175 arg_desc->AddOptionalKey 00176 ("F", "Feature", 00177 "v Visit, g Gene Overlap Print, h Gene Overlap Speed, x Xref, o Operon s Suggest", 00178 CArgDescriptions::eString); 00179 arg_desc->SetConstraint 00180 ("F", &(*new CArgAllow_Strings, "v", "g", "h", "x", "o", "s")); 00181 00182 // Setup arg.descriptions for this application 00183 SetupArgDescriptions(arg_desc.release()); 00184 } 00185 00186 00187 00188 ///////////////////////////////////////////////////////////////////////////// 00189 00190 void CMytestApplication::DoProcessStreamFasta ( 00191 CNcbiIstream& ip, 00192 CNcbiOstream& op, 00193 CRef<CSeq_entry>& se 00194 ) 00195 { 00196 CFastaOstream fo (op); 00197 for (CTypeConstIterator<CBioseq> bit (*se); bit; ++bit) { 00198 fo.Write (*bit, 0, m_no_scope); 00199 } 00200 } 00201 00202 ///////////////////////////////////////////////////////////////////////////// 00203 00204 void CMytestApplication::DoProcessStreamDefline ( 00205 CNcbiIstream& ip, 00206 CNcbiOstream& op, 00207 CRef<CSeq_entry>& se, 00208 CScope& scope 00209 ) 00210 { 00211 CFastaOstream fo (op); 00212 for (CTypeConstIterator<CBioseq> bit (*se); bit; ++bit) { 00213 // fo.WriteTitle (scope.GetBioseqHandle(*bit)); 00214 fo.WriteTitle (*bit, 0, m_no_scope); 00215 00216 } 00217 } 00218 00219 //////////////////////////////////////////////////////////////////////////////// 00220 string SeqLocString( const CSeq_loc& loc ) 00221 { 00222 string str; 00223 loc.GetLabel(&str); 00224 return str; 00225 } 00226 00227 //////////////////////////////////////////////////////////////////////////////// 00228 00229 int CMytestApplication::TestFeatureGeneOverlap ( 00230 CNcbiIstream& ip, 00231 CNcbiOstream& op, 00232 CScope& scope, 00233 CSeq_feat& f, 00234 bool do_format ) 00235 { 00236 if ( f.GetData().Which() == CSeqFeatData::e_Gene ) { 00237 return 1; 00238 } 00239 const CSeq_feat_Base::TLocation& locbase = f.GetLocation(); 00240 CConstRef<CSeq_feat> ol = GetOverlappingGene( locbase, scope ); 00241 if ( ! ol ) { 00242 return 1; 00243 } 00244 if (do_format) { 00245 op << SeqLocString( locbase ) << " -> " 00246 << SeqLocString( ol->GetLocation() ) << '\n'; 00247 } 00248 return 1; 00249 } 00250 00251 //////////////////////////////////////////////////////////////////////////////// 00252 00253 int CMytestApplication::DoProcessFeatureSuggest ( 00254 CNcbiIstream& ip, 00255 CNcbiOstream& op, 00256 CScope& scope, 00257 CRef<CSeq_entry>& se, 00258 bool do_format ) 00259 { 00260 CProSplign prosplign; 00261 return 0; 00262 } 00263 00264 //////////////////////////////////////////////////////////////////////////////// 00265 00266 int CMytestApplication::TestFeatureGeneOverlap ( 00267 CNcbiIstream& ip, 00268 CNcbiOstream& op, 00269 CScope& scope, 00270 CSeq_annot& sa, 00271 bool do_format ) 00272 { 00273 int count = 0; 00274 if ( sa.IsSetData() && sa.GetData().IsFtable() ) { 00275 NON_CONST_ITERATE( CSeq_annot::TData::TFtable, it, sa.SetData().SetFtable() ) { 00276 count += TestFeatureGeneOverlap( ip, op, scope, **it, do_format ); 00277 } 00278 } 00279 return count; 00280 } 00281 00282 //////////////////////////////////////////////////////////////////////////////// 00283 00284 int CMytestApplication::TestFeatureGeneOverlap ( 00285 CNcbiIstream& ip, 00286 CNcbiOstream& op, 00287 CScope& scope, 00288 CBioseq& bs, 00289 bool do_format ) 00290 { 00291 int count = 0; 00292 if (bs.IsSetAnnot()) { 00293 NON_CONST_ITERATE (CBioseq::TAnnot, it, bs.SetAnnot()) { 00294 count += TestFeatureGeneOverlap( ip, op, scope, **it, do_format ); 00295 } 00296 } 00297 return count; 00298 } 00299 00300 //////////////////////////////////////////////////////////////////////////////// 00301 00302 int CMytestApplication::DoProcessFeatureGeneOverlap ( 00303 CNcbiIstream& ip, 00304 CNcbiOstream& op, 00305 CScope& scope, 00306 CRef<CSeq_entry>& se, 00307 bool do_format ) 00308 { 00309 int count = 0; 00310 switch (se->Which()) { 00311 00312 case CSeq_entry::e_Seq: 00313 count += TestFeatureGeneOverlap( ip, op, scope, se->SetSeq(), do_format ); 00314 break; 00315 00316 case CSeq_entry::e_Set: { 00317 CBioseq_set& bss( se->SetSet() ); 00318 if (bss.IsSetAnnot()) { 00319 NON_CONST_ITERATE (CBioseq::TAnnot, it, bss.SetAnnot()) { 00320 count += TestFeatureGeneOverlap( ip, op, scope, **it, do_format ); 00321 } 00322 } 00323 00324 if (bss.IsSetSeq_set()) { 00325 NON_CONST_ITERATE (CBioseq_set::TSeq_set, it, bss.SetSeq_set()) { 00326 count += DoProcessFeatureGeneOverlap( ip, op, scope, *it, do_format ); 00327 } 00328 } 00329 break; 00330 } 00331 00332 case CSeq_entry::e_not_set: 00333 default: 00334 break; 00335 } 00336 return count; 00337 } 00338 00339 ///////////////////////////////////////////////////////////////////////////// 00340 00341 void CMytestApplication::DoProcess ( 00342 CNcbiIstream& ip, 00343 CNcbiOstream& op, 00344 CScope& scope, 00345 CRef<CSeq_entry>& se 00346 ) 00347 00348 { 00349 if (m_bsec) { 00350 CCleanup Cleanup; 00351 Cleanup.BasicCleanup( se.GetObject() ); 00352 } 00353 if (m_ssec) { 00354 // need to implement 00355 } 00356 00357 if (m_fidx) { 00358 // need to implement 00359 } 00360 00361 if (m_fasta) { 00362 DoProcessStreamFasta( ip, op, se ); 00363 return; 00364 } 00365 if (m_defline_only) { 00366 DoProcessStreamDefline( ip, op, se, scope ); 00367 return; 00368 } 00369 if (m_nodef) { 00370 // need to implement 00371 } 00372 if (m_featfa) { 00373 // need to implement 00374 } 00375 if (m_transl) { 00376 // need to implement 00377 } 00378 if (m_svisit) { 00379 for (CTypeConstIterator<CBioseq> bit (*se); bit; ++bit) { 00380 if (m_ostream) { 00381 CFastaOstream fo (op); 00382 } 00383 } 00384 } 00385 if (m_ostream && (! m_svisit)) { 00386 CFastaOstream fo (op); 00387 } 00388 00389 if (m_fvisit) { 00390 for (CTypeConstIterator<CBioseq> bit (*se); bit; ++bit) { 00391 // need to implement 00392 } 00393 } 00394 if (m_goverlap) { 00395 DoProcessFeatureGeneOverlap( ip, op, scope, se, true ); 00396 } 00397 if (m_hoverlap) { 00398 DoProcessFeatureGeneOverlap( ip, op, scope, se, false ); 00399 } 00400 if (m_gxref) { 00401 // need to implement 00402 } 00403 if (m_ooverlap) { 00404 // need to implement 00405 } 00406 } 00407 00408 // ============================================================================ 00409 void 00410 CMytestApplication::DumpAlignment( 00411 CNcbiOstream& Os, 00412 CRef<CSeq_align>& align ) 00413 // ============================================================================ 00414 { 00415 Os << MSerial_AsnText << *align << endl; 00416 } 00417 00418 // ============================================================================ 00419 int 00420 CMytestApplication::PlayAroundWithSuggestIntervals( 00421 CNcbiIstream& is, 00422 CNcbiOstream& os, 00423 CScope& scope, 00424 CRef<CSeq_entry>& se ) 00425 // ============================================================================ 00426 { 00427 CSeq_entry_Handle entry; 00428 try { 00429 entry = scope.GetSeq_entryHandle( *se ); 00430 } catch ( CException& ) {} 00431 00432 if ( !entry ) { // add to scope if not already in it 00433 entry = scope.AddTopLevelSeqEntry( *se ); 00434 } 00435 CBioseq_set::TClass clss = entry.GetSet().GetClass(); 00436 if (clss != CBioseq_set::eClass_nuc_prot) { 00437 return 1; 00438 } 00439 CRef<CSeq_loc> nucloc; 00440 list< CConstRef<CSeq_id> > proteins; 00441 00442 CSeq_inst::TMol mol_type = CSeq_inst::eMol_not_set; 00443 CBioseq_CI seq_iter(entry, mol_type, CBioseq_CI::eLevel_Mains); 00444 for ( ; seq_iter; ++seq_iter ) { 00445 const CBioseq_Handle& bs = *seq_iter; 00446 if (bs.IsNa()) { 00447 // const CSeq_id& nucid = ( *bs.GetSeqId() ); 00448 // nucloc.Reset( new CSeq_loc( nucid, 0, (int)bs.GetInst_Length(),eNa_strand_unknown ) ); 00449 nucloc.Reset( bs.GetRangeSeq_loc(0, bs.GetInst_Length() ) ); 00450 // nucloc.Reset( bs.GetRangeSeq_loc(0, 0 ) ); 00451 } 00452 else if (bs.IsAa()) { 00453 proteins.push_back( bs.GetSeqId() ); 00454 } 00455 } 00456 00457 CProSplign prosplign; 00458 list< CConstRef<CSeq_id> >::iterator it = proteins.begin(); 00459 for ( ; it != proteins.end(); ++it ) { 00460 CRef<CSeq_align> alignment = prosplign.FindAlignment( 00461 scope, 00462 **it, 00463 *nucloc ); 00464 DumpAlignment( os, alignment ); 00465 } 00466 os.flush(); 00467 return 0; 00468 } 00469 00470 00471 //////////////////////////////////////////////////////////////////////////////// 00472 void CMytestApplication::GetSeqEntry( 00473 CNcbiIstream& ip, 00474 CRef<CSeq_entry>& se ) 00475 { 00476 string asntype = GetArgs()["a"].AsString(); 00477 auto_ptr<CObjectIStream> is (CObjectIStream::Open (eSerial_AsnText, ip)); 00478 is->SetStreamPos( 0 ); 00479 00480 if ( asntype == "a" || asntype == "m" ) { 00481 try { 00482 CRef<CSeq_submit> sub(new CSeq_submit()); 00483 *is >> *sub; 00484 se.Reset( sub->SetData().SetEntrys().front() ); 00485 return; 00486 } 00487 catch( ... ) { 00488 is->SetStreamPos( 0 ); 00489 } 00490 } 00491 if ( asntype == "a" || asntype == "e" ) { 00492 try { 00493 *is >> *se; 00494 return; 00495 } 00496 catch( ... ) { 00497 is->SetStreamPos( 0 ); 00498 } 00499 } 00500 if ( asntype == "a" || asntype == "b" ) { 00501 try { 00502 CRef<CBioseq> bs( new CBioseq ); 00503 *is >> *bs; 00504 se->SetSeq( bs.GetObject() ); 00505 return; 00506 } 00507 catch( ... ) { 00508 is->SetStreamPos( 0 ); 00509 } 00510 } 00511 if ( asntype == "a" || asntype == "s" ) { 00512 try { 00513 CRef<CBioseq_set> bss( new CBioseq_set ); 00514 *is >> *bss; 00515 se->SetSet( bss.GetObject() ); 00516 return; 00517 } 00518 catch( ... ) { 00519 // is->SetStreamPos( 0 ); 00520 } 00521 } 00522 } 00523 00524 00525 //////////////////////////////////////////////////////////////////////////////// 00526 int CMytestApplication::Run(void) 00527 { 00528 // Get arguments 00529 const CArgs& args = GetArgs(); 00530 00531 CNcbiIstream& ip = args["i"].AsInputFile(); 00532 CNcbiOstream& op = args["o"].AsOutputFile(); 00533 00534 string tp = args["a"].AsString(); 00535 00536 int mx = args["X"].AsInteger(); 00537 if (mx < 1) { 00538 mx = 1; 00539 } 00540 00541 m_bsec = false; 00542 m_ssec = false; 00543 00544 m_fidx = false; 00545 00546 m_fasta = false; 00547 m_nodef = false; 00548 m_featfa = false; 00549 m_transl = false; 00550 m_svisit = false; 00551 m_ostream = false; 00552 00553 m_fvisit = false; 00554 m_goverlap = false; 00555 m_hoverlap = false; 00556 m_gxref = false; 00557 m_ooverlap = false; 00558 00559 m_defline_only = false; 00560 m_suggest = false; 00561 00562 if (args["K"]) { 00563 string km = args["K"].AsString(); 00564 if (NStr::Find (km, "b") != NPOS) { 00565 m_bsec = true; 00566 } 00567 if (NStr::Find (km, "s") != NPOS) { 00568 m_ssec = true; 00569 } 00570 } 00571 00572 if (args["I"]) { 00573 string im = args["I"].AsString(); 00574 if (NStr::Find (im, "f") != NPOS) { 00575 m_fidx = true; 00576 } 00577 } 00578 00579 if (args["S"]) { 00580 string sm = args["S"].AsString(); 00581 if (NStr::Find (sm, "S") != NPOS) { 00582 m_fasta = true; 00583 m_no_scope = true; 00584 } 00585 if (NStr::Find (sm, "s") != NPOS) { 00586 m_fasta = true; 00587 m_no_scope = false; 00588 } 00589 if (NStr::Find (sm, "r") != NPOS) { 00590 m_nodef = true; 00591 } 00592 if (NStr::Find (sm, "D") != NPOS) { 00593 m_defline_only = true; 00594 m_no_scope = true; 00595 } 00596 if (NStr::Find (sm, "d") != NPOS) { 00597 m_defline_only = true; 00598 m_no_scope = false; 00599 } 00600 if (NStr::Find (sm, "f") != NPOS) { 00601 m_featfa = true; 00602 } 00603 if (NStr::Find (sm, "t") != NPOS) { 00604 m_transl = true; 00605 } 00606 if (NStr::Find (sm, "v") != NPOS) { 00607 m_svisit = true; 00608 } 00609 if (NStr::Find (sm, "o") != NPOS) { 00610 m_ostream = true; 00611 } 00612 } 00613 00614 if (args["F"]) { 00615 string fm = args["F"].AsString(); 00616 if (NStr::Find (fm, "v") != NPOS) { 00617 m_fvisit = true; 00618 } 00619 if (NStr::Find (fm, "g") != NPOS) { 00620 m_goverlap = true; 00621 } 00622 if (NStr::Find (fm, "h") != NPOS) { 00623 m_hoverlap = true; 00624 } 00625 if (NStr::Find (fm, "x") != NPOS) { 00626 m_gxref = true; 00627 } 00628 if (NStr::Find (fm, "o") != NPOS) { 00629 m_ooverlap = true; 00630 } 00631 if (NStr::Find (fm, "s") != NPOS) { 00632 m_suggest = true; 00633 } 00634 } 00635 00636 int ct; 00637 CStopWatch sw; 00638 sw.Start(); 00639 double lastInterval( 0 ); 00640 00641 // read line at a time if indicated 00642 if (NStr::Equal(tp, "l")) { 00643 string str; 00644 00645 while (NcbiGetlineEOL (ip, str)) { 00646 if (! str.empty ()) { 00647 // op << str << endl; 00648 } 00649 } 00650 00651 lastInterval = sw.Elapsed() - lastInterval; 00652 NcbiCout << "Read by line time is " << lastInterval << " seconds" << endl; 00653 return 0; 00654 } 00655 00656 CRef<CObjectManager> objmgr = CObjectManager::GetInstance(); 00657 if ( !objmgr ) { 00658 /* raise hell */; 00659 } 00660 CRef<CScope> scope( new CScope( *objmgr ) ); 00661 if ( !scope ) { 00662 /* raise hell */; 00663 } 00664 scope->AddDefaults(); 00665 00666 // otherwise read ASN.1 00667 CRef<CSeq_entry> se(new CSeq_entry); 00668 GetSeqEntry( ip, se ); 00669 if ( ! se ) { 00670 return 1; 00671 } 00672 00673 if ( m_suggest ) { 00674 int iRet = PlayAroundWithSuggestIntervals( ip, op, *scope, se ); 00675 lastInterval = sw.Elapsed() - lastInterval; 00676 NcbiCout << "Internal processing time is " << lastInterval << " seconds" << endl; 00677 return iRet; 00678 } 00679 00680 scope->AddTopLevelSeqEntry(const_cast<const CSeq_entry&>(*se)); 00681 00682 lastInterval = sw.Elapsed() - lastInterval; 00683 NcbiCout << "ASN reading time is " << lastInterval << " seconds" << endl; 00684 00685 for (ct = 0; ct < mx; ct++) { 00686 DoProcess (ip, op, *scope, se); 00687 } 00688 00689 lastInterval = sw.Elapsed() - lastInterval; 00690 NcbiCout << "Internal processing time is " << lastInterval << " seconds" << endl; 00691 00692 // write ASN.1 00693 /* 00694 if (NStr::Equal (fm, "a")) { 00695 auto_ptr<CObjectOStream> os (CObjectOStream::Open (eSerial_AsnText, op)); 00696 *os << *se; 00697 t2.SetCurrent(); 00698 tx = t2.DiffSecond (t1); 00699 NcbiCout << "elapsed time is " << tx << endl; 00700 return 0; 00701 } 00702 */ 00703 00704 return 0; 00705 } 00706 00707 00708 ///////////////////////////////////////////////////////////////////////////// 00709 00710 00711 void CMytestApplication::Exit(void) 00712 { 00713 SetDiagStream(0); 00714 } 00715 00716 00717 ///////////////////////////////////////////////////////////////////////////// 00718 00719 00720 int main(int argc, const char* argv[]) 00721 { 00722 // Execute main application function 00723 return CMytestApplication().AppMain(argc, argv, 0, eDS_Default, 0); 00724 } 00725
1.7.5.1
Modified on Wed May 23 13:06:20 2012 by modify_doxy.py rev. 337098