: m_ostream{o_stream},
54m_DuplicateIdPolicy{policy} {}
66 autonext_function = [
this]()
73 Write(topobj, next_function);
74}, std::move(topobject));
98 if(duplicateIds.
empty()) {
101 string msg=
"duplicate Bioseq id";
102 if(duplicateIds.
size() > 1) {
105 for(
autopId : duplicateIds) {
115 size_tbioseq_level = 0;
118[&bioseq_level, get_next_entry]
122if (bioseq_level == 1)
124COStreamContainer out_container(out, object.GetTypeInfo());
125CConstRef<CSeq_entry> entry;
126while((entry = get_next_entry()))
129out_container << *entry;
133object.GetTypeInfo()->DefaultWriteData(out, object.GetObjectPtr());
139 TIdSetprocessedIds, duplicateIds;
146 out.WriteClassMember(member);
148 for(
autopId : container) {
149 if(!processedIds.insert(pId).second) {
150 if(m_DuplicateIdPolicy == eThrowImmediately) {
154duplicateIds.insert(pId);
161m_ostream->Write(topobject, topobject->GetThisTypeInfo());
static void s_ReportDuplicateIds(const TIdSet &duplicateIds)
virtual ~CGenBankAsyncWriter()
std::future< void > m_writer_task
void PushNextEntry(CConstRef< CSeq_entry > entry)
void StartWriter(CConstRef< CSerialObject > topobject)
void Write(CConstRef< CSerialObject > topobject)
CMessageQueue< CConstRef< CSeq_entry > > m_write_queue
std::function< CConstRef< CSeq_entry >()> TGetNextFunction
CObjectOStream * m_ostream
std::ofstream out("events_result.xml")
main entry point for tests
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
string GetLabel(const CSeq_id &id)
static C * GetUnchecked(const CObjectInfo &object)
CMemberIterator FindMember(const string &memberName) const
Find class member by its name.
void Write(const CConstObjectInfo &object)
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
Magic spell ;-) needed for some weird compilers... very empiric.
void SetLocalWriteHook(const CObjectTypeInfo &obj_type_info, CObjectOStream &ostr, _Func _func)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Compare objects pointed to by (smart) pointer.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4