本文整理汇总了C++中CObjectIStream::GetStackPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CObjectIStream::GetStackPath方法的具体用法?C++ CObjectIStream::GetStackPath怎么用?C++ CObjectIStream::GetStackPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObjectIStream
的用法示例。
在下文中一共展示了CObjectIStream::GetStackPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkipClassMember
virtual void SkipClassMember(CObjectIStream& in,
const CObjectTypeInfoMI& passed_info)
{
cout << in.GetStackPath() << endl;
#if 1
DefaultSkip(in, passed_info);
#else
// get information about the member
// typeinfo of the parent class (Bioseq)
CObjectTypeInfo oti = passed_info.GetClassType();
// typeinfo of the member (SET OF Seq-annot)
CObjectTypeInfo omti = passed_info.GetMemberType();
// index of the member in parent class (4)
TMemberIndex mi = passed_info.GetMemberIndex();
// information about the member, including its name (annot)
const CMemberInfo* minfo = passed_info.GetMemberInfo();
#if 1
// or read the whole SET OF Seq-annot at once
CObjectInfo oi(passed_info);
DefaultRead(in, oi);
cout << MSerial_AsnText << oi << endl;
#endif
#if 0
// or read CSeq_annot objects one by one and write them into stdout
unique_ptr<CObjectOStream> out(CObjectOStream::Open(eSerial_AsnText, "stdout", eSerial_StdWhenStd));
COStreamContainer o(*out, passed_info);
for ( CIStreamContainerIterator i(in, passed_info); i; ++i ) {
CSeq_annot annot;
i >> annot;
// NOTE: this does not produce well formed text ASN, because of missing typeinfo name
// this would work though if we copied data into existing ASN stream
// where typeinfo name ("file header") is not required
o << annot;
// if we needed well formed text ASN, we could write it like this:
// cout << MSerial_AsnText << annot;
}
#endif
#if 0
// or read the whole SET OF Seq-annot at once
CBioseq::TAnnot annot;
CObjectInfo oi(&annot, passed_info.GetMemberType().GetTypeInfo());
in.ReadObject(oi);
// write them one by one
for( const auto& e: annot) {
cout << MSerial_AsnText << *e << endl;
}
// or write them all at once
unique_ptr<CObjectOStream> out(CObjectOStream::Open(eSerial_AsnText, "stdout", eSerial_StdWhenStd));
out->WriteObject(oi);
#endif
#endif
}
示例2: SkipChoiceVariant
virtual void SkipChoiceVariant(CObjectIStream& in,
const CObjectTypeInfoCV& passed_info)
{
cout << in.GetStackPath() << endl;
#if 1
DefaultSkip(in, passed_info);
#else
// get information about the variant
// typeinfo of the parent class (Seq-annot.data)
CObjectTypeInfo oti = passed_info.GetChoiceType();
// typeinfo of the variant (SET OF Seq-feat)
CObjectTypeInfo omti = passed_info.GetVariantType();
// index of the variant in parent class (1)
TMemberIndex mi = passed_info.GetVariantIndex();
// information about the variant, including its name (ftable)
const CVariantInfo* minfo = passed_info.GetVariantInfo();
#if 1
// or read the whole SET OF Seq-feat at once
CObjectInfo oi(passed_info);
DefaultRead(in, oi);
cout << MSerial_AsnText << oi << endl;
#endif
#if 0
// or read CSeq_feat objects one by one
for ( CIStreamContainerIterator i(in, passed_info.GetVariantType()); i; ++i ) {
CSeq_feat feat;
i >> feat;
cout << MSerial_AsnText << feat << endl;
}
#endif
#if 0
// or read CSeq_feat objects one by one and write them into stdout
unique_ptr<CObjectOStream> out(CObjectOStream::Open(eSerial_AsnText, "stdout", eSerial_StdWhenStd));
COStreamContainer o(*out, passed_info.GetVariantType());
for ( CIStreamContainerIterator i(in, passed_info.GetVariantType()); i; ++i ) {
CSeq_feat feat;
i >> feat;
// NOTE: this does not produce well formed text ASN, because of missing typeinfo name
// this would work though if we copied data into existing ASN stream
// where typeinfo name ("file header") is not required
// o << feat;
// if we needed well formed text ASN, we could write it like this:
cout << MSerial_AsnText << feat;
}
#endif
#if 0
// or read the whole SET OF Seq-feat at once
CSeq_annot::TData::TFtable ft;
CObjectInfo oi(&ft, passed_info.GetVariantType().GetTypeInfo());
// or, like this:
// CObjectInfo oi(passed_info.GetVariantType());
in.ReadObject(oi);
// write them one by one
for( const auto& e: ft) {
cout << MSerial_AsnText << *e << endl;
}
// or write them all at once
unique_ptr<CObjectOStream> out(CObjectOStream::Open(eSerial_AsnText, "stdout", eSerial_StdWhenStd));
out->WriteObject(oi);
#endif
#endif
}