⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 document.cpp

📁 ncbi源码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    // event routing    IEventTransmitter * vt = view->QueryInterfaceTransmitter();    if (vt) vt->SetHost(this);    }void CDocument::DetachView(IView* view){    CMutexGuard LOCK(m_Mutex);    CRef<IView> ref(view);    m_Views.remove(ref);    // Remove view to "All Views" message pool    x_GetAllViewsPool().Leave(*view);    // Remove view from group message pool and map    TViewGroupPools::iterator iter = m_ViewGroupPools.find(view);    if (iter != m_ViewGroupPools.end()) {        (iter->second)->Leave(*view);        m_ViewGroupPools.erase(iter);    }    PostViewReleased(*view);    CDocManager::UpdateAllViews(fViewReleased);}//// clear this document//void CDocument::Clear(){    CMutexGuard LOCK(m_Mutex);    m_Views.clear();    // clear the message pools    m_AllViewsPool.Reset();    m_ViewGroupPools.clear();    m_MsgPoolMgr.reset();}void CDocument::AttachAnnot(CSeq_annot& annot){    CObjectConverter::TObjList objs;    CObjectConverter::Convert(GetScope(), annot,                              CSeq_entry::GetTypeInfo(), objs);    ITERATE (CObjectConverter::TObjList, obj_iter, objs) {        const CSeq_entry* entry =            dynamic_cast<const CSeq_entry*>(obj_iter->GetPointer());        if ( !entry ) {            continue;        }        GetScope().AddTopLevelSeqEntry(const_cast<CSeq_entry&>(*entry));    }}// Transmitter/reciever QIIEventTransmitter * CDocument::QueryInterfaceTransmitter(void){    return dynamic_cast<IEventTransmitter*>(this);}IEventReceiver    * CDocument::QueryInterfaceReceiver(void){    return dynamic_cast<IEventReceiver*>(this);}void CDocument::SetHost(IEventTransmitter * host){    _TRACE("Error: SetHost for CDocument - something gone wrong...");}void CDocument::FireEvent(const CEvent * evt){    CDocManager::NotifyAllViews(evt);}void CDocument::OnEvent(const CEvent * evt){   NON_CONST_ITERATE (TViews, iter, m_Views) {       IEventTransmitter * vt = (*iter)->QueryInterfaceTransmitter();       IEventReceiver    * vr = (*iter)->QueryInterfaceReceiver();              if (vr) {            if (vt && evt->GetSender()==vt) continue;                        vr->OnEvent(evt);       }   }}END_NCBI_SCOPE/* * =========================================================================== * $Log: document.cpp,v $ * Revision 1000.5  2004/06/01 20:44:03  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.48 * * Revision 1.48  2004/05/21 22:27:40  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.47  2004/05/17 13:19:35  dicuccio * Removed old document workspace * * Revision 1.46  2004/03/30 17:09:25  tereshko * Added support for events broadcasting * * Revision 1.45  2004/01/21 12:38:18  dicuccio * redesigned CObjectCOnverter API to eliminate temporary object creation * * Revision 1.44  2004/01/15 17:59:20  dicuccio * Rearranged initializers to avoid warning * * Revision 1.43  2003/12/31 20:26:34  dicuccio * Added internal wrappers for accessing view message pools.  Fixed error in * Clear() - must also delete view groups's pools (caused failure to dereference * all documents and views) * * Revision 1.42  2003/12/22 19:19:24  dicuccio * Clarified process of posting messages to other views.  Removed CView::Update(). * * Revision 1.41  2003/11/19 20:40:41  friedman * Added grouping views into group message pools * * Revision 1.40  2003/11/18 17:40:16  dicuccio * Changed AttachAnnot() to create a parallel seq-entry rather than attaching * directly to the current seq-entry * * Revision 1.39  2003/11/14 17:45:33  dicuccio * Added Clear() - clears view list and view pool manager.  Changed AttachAnnot() * - don't attach directly to original data.  Added resize for window to fit * screen if the resolution is smaller than the window size. * * Revision 1.38  2003/11/06 20:03:02  dicuccio * Added parameter to AttachView() for view message pool * * Revision 1.37  2003/11/04 17:16:43  dicuccio * Use CObjectCOnverter instead of CPluginUtils.  Added code to reposition views * on creation to tile nicely on the screen. * * Revision 1.36  2003/11/04 13:08:53  dicuccio * Changed storage of message pool to CRef<> from C++ reference * * Revision 1.35  2003/11/04 12:45:34  friedman * Added all view message pool to be invoked fom UpdateAllViews. Replaces * iterating through the all the views and calling Update. * * Revision 1.34  2003/10/10 17:13:34  dicuccio * Implemented DetachView().  Notify doc manager on view creation / view release * * Revision 1.33  2003/09/04 14:01:51  dicuccio * Introduce IDocument and IView as abstract base classes for CDocument and CView * * Revision 1.32  2003/08/05 17:02:08  dicuccio * Changed static counter to match coding standard * * Revision 1.31  2003/07/31 16:53:44  dicuccio * Added unique ID for each document * * Revision 1.30  2003/07/22 15:28:31  dicuccio * Adjusted AttachAnnot() to match API changes in CPluginUtils::Convert() * * Revision 1.29  2003/06/25 17:02:54  dicuccio * Split CPluginHandle into a handle (pointer-to-implementation) and * implementation file.  Lots of #include file clean-ups. * * Revision 1.28  2003/06/23 13:23:12  dicuccio * Deprecated seq_utils.[h,c]pp - moved functions into gui.utils/utils.hpp * * Revision 1.27  2003/06/17 19:11:49  dicuccio * Added AttachAnnot() * * Revision 1.26  2003/06/02 16:06:17  dicuccio * Rearranged src/objects/ subtree.  This includes the following shifts: *     - src/objects/asn2asn --> arc/app/asn2asn *     - src/objects/testmedline --> src/objects/ncbimime/test *     - src/objects/objmgr --> src/objmgr *     - src/objects/util --> src/objmgr/util *     - src/objects/alnmgr --> src/objtools/alnmgr *     - src/objects/flat --> src/objtools/flat *     - src/objects/validator --> src/objtools/validator *     - src/objects/cddalignview --> src/objtools/cddalignview * In addition, libseq now includes six of the objects/seq... libs, and libmmdb * replaces the three libmmdb? libs. * * Revision 1.25  2003/05/09 14:29:51  dicuccio * Cleaned out unnecessary local scope * * Revision 1.24  2003/05/08 16:18:59  dicuccio * Changed CFastMutex --> CMutex - guards against recursive locking * * Revision 1.23  2003/05/05 12:41:55  dicuccio * Added mutex to guard access to CDocument's members * * Revision 1.22  2003/04/29 14:38:04  dicuccio * Removed old typing system * * Revision 1.21  2003/04/24 16:27:47  dicuccio * Large API / internals change.  Made CDocument an abstract base class; removed * notion of document == bioseq-handle * * Revision 1.20  2003/04/16 11:38:32  dicuccio * Cleaned up CDocument's destructor * * Revision 1.19  2003/04/10 19:48:37  dicuccio * Made text description a member variable * * Revision 1.18  2003/03/31 13:42:18  dicuccio * Disabled MDI interface (for now).  Changed mechanism of subtype determination * to take advantage of more efficient scope resolution * * Revision 1.17  2003/03/17 14:49:41  dicuccio * Added top-level workspace, one per document.  Added Hide()/Show() functions * for the workspace.  Removed header-file dependency on view.hpp * * Revision 1.16  2003/03/10 22:58:51  kuznets * iterate -> ITERATE * * Revision 1.15  2003/03/03 15:18:46  dicuccio * Added views slaved indicator (false by default) * * Revision 1.14  2003/02/26 14:19:36  dicuccio * Removed some unecessary _TARCE() statements * * Revision 1.13  2003/02/20 19:49:55  dicuccio * Created new plugin architecture, based on ASN.1 spec.  Moved GBENCH frameowrk * over to use new plugin architecture. * * Revision 1.12  2003/02/10 18:52:58  dicuccio * Fixed compilation issues relating to CFeat_CI API change * * Revision 1.11  2003/02/10 18:12:59  dicuccio * Changed mechanism for determining types to a document's features (more * efficient mechanism is used) * * Revision 1.10  2003/02/05 19:52:57  dicuccio * Cleaned up data management - save the scope for the bioseq separate from the * bioseq; assure that shut-down happens carefully; limit the calls to * x_SetTypes() * * Revision 1.9  2003/01/13 13:10:06  dicuccio * Namespace clean-up.  Retired namespace gui -> converted all to namespace ncbi. * Moved all FLUID-generated code into namespace ncbi. * * Revision 1.8  2003/01/08 15:33:09  dicuccio * Make sure that all Bioseq-set types are parsed. * * Revision 1.7  2003/01/08 14:49:52  dicuccio * Revamped type resolution system - now, each record stores a list of the * available types relevant for that record.  This permits record typing based on * sub-component presence. * * Revision 1.6  2002/12/09 20:33:52  dicuccio * Use seqience::GetTitle instead of home-grown approach * * Revision 1.5  2002/11/25 20:53:51  dicuccio * Added Set() function for bioseq-handle - used by data loader plugins.  Added * default ctor. * * Revision 1.4  2002/11/14 16:16:48  dicuccio * Added 'pop-set' ast document type.  Sorted document types in GetType(). * * Revision 1.3  2002/11/09 20:50:09  dicuccio * Changed CDocument::x_GetViews() (non-const) and x_AttachView() from private to * public. * * Revision 1.2  2002/11/07 18:40:05  dicuccio * Various std::string fixes (use string::empty(); use implicit creation for * return from const char* <-> string). * Chanegd code to use ERR_POST() and _TRACE(). * * Revision 1.1  2002/11/06 15:49:48  dicuccio * Initial revision * * =========================================================================== */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -