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

📄 continfo.inl

📁 ncbi源码
💻 INL
字号:
/* * =========================================================================== * PRODUCTION $Log: continfo.inl,v $ * PRODUCTION Revision 1000.1  2004/04/12 17:14:33  gouriano * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.5 * PRODUCTION * =========================================================================== */#if defined(CONTINFO__HPP)  &&  !defined(CONTINFO__INL)#define CONTINFO__INL/*  $Id: continfo.inl,v 1000.1 2004/04/12 17:14:33 gouriano Exp $* ===========================================================================**                            PUBLIC DOMAIN NOTICE*               National Center for Biotechnology Information**  This software/database is a "United States Government Work" under the*  terms of the United States Copyright Act.  It was written as part of*  the author's official duties as a United States Government employee and*  thus cannot be copyrighted.  This software/database is freely available*  to the public for use. The National Library of Medicine and the U.S.*  Government have not placed any restriction on its use or reproduction.**  Although all reasonable efforts have been taken to ensure the accuracy*  and reliability of the software and data, the NLM and the U.S.*  Government do not and cannot warrant the performance or results that*  may be obtained by using this software or data. The NLM and the U.S.*  Government disclaim all warranties, express or implied, including*  warranties of performance, merchantability or fitness for any particular*  purpose.**  Please cite the author in any work or product based on this material.** ===========================================================================** Author: Eugene Vasilchenko** File Description:*   !!! PUT YOUR DESCRIPTION HERE !!!*/inlineTTypeInfo CContainerTypeInfo::GetElementType(void) const{    return m_ElementType.Get();}inlinebool CContainerTypeInfo::RandomElementsOrder(void) const{    return m_RandomOrder;}inlineCContainerTypeInfo::CConstIterator::CConstIterator(void)    : m_ContainerType(0), m_ContainerPtr(0), m_IteratorData(0){}inlineCContainerTypeInfo::CConstIterator::~CConstIterator(void){    const CContainerTypeInfo* containerType = m_ContainerType;    if ( containerType )        containerType->ReleaseIterator(*this);}inlineconst CContainerTypeInfo*CContainerTypeInfo::CConstIterator::GetContainerType(void) const{    return m_ContainerType;}inlineCContainerTypeInfo::CConstIterator::TObjectPtrCContainerTypeInfo::CConstIterator::GetContainerPtr(void) const{    return m_ContainerPtr;}inlinevoid CContainerTypeInfo::CConstIterator::Reset(void){    const CContainerTypeInfo* containerType = m_ContainerType;    if ( containerType ) {        containerType->ReleaseIterator(*this);        m_ContainerType = 0;        m_ContainerPtr = 0;        m_IteratorData = 0;    }}inlineCContainerTypeInfo::CIterator::CIterator(void)    : m_ContainerType(0), m_ContainerPtr(0), m_IteratorData(0){}inlineCContainerTypeInfo::CIterator::~CIterator(void){    const CContainerTypeInfo* containerType = m_ContainerType;    if ( containerType )        containerType->ReleaseIterator(*this);}inlineconst CContainerTypeInfo*CContainerTypeInfo::CIterator::GetContainerType(void) const{    return m_ContainerType;}inlineCContainerTypeInfo::CIterator::TObjectPtrCContainerTypeInfo::CIterator::GetContainerPtr(void) const{    return m_ContainerPtr;}inlinevoid CContainerTypeInfo::CIterator::Reset(void){    const CContainerTypeInfo* containerType = m_ContainerType;    if ( containerType ) {        containerType->ReleaseIterator(*this);        m_ContainerType = 0;        m_ContainerPtr = 0;        m_IteratorData = 0;    }}inlinebool CContainerTypeInfo::InitIterator(CConstIterator& it,                                      TConstObjectPtr obj) const{    it.Reset();    it.m_ContainerType = this;    it.m_ContainerPtr = obj;    return m_InitIteratorConst(it);}inlinevoid CContainerTypeInfo::ReleaseIterator(CConstIterator& it) const{    _ASSERT(it.m_ContainerType == this);    m_ReleaseIteratorConst(it);}inlinevoid CContainerTypeInfo::CopyIterator(CConstIterator& dst,                                      const CConstIterator& src) const{    _ASSERT(src.m_ContainerType == this);    dst.Reset();    dst.m_ContainerType = this;    dst.m_ContainerPtr = src.m_ContainerPtr;    m_CopyIteratorConst(dst, src);}inlinebool CContainerTypeInfo::NextElement(CConstIterator& it) const{    _ASSERT(it.m_ContainerType == this);    return m_NextElementConst(it);}inlineTConstObjectPtrCContainerTypeInfo::GetElementPtr(const CConstIterator& it) const{    _ASSERT(it.m_ContainerType == this);    return m_GetElementPtrConst(it);}inlinebool CContainerTypeInfo::InitIterator(CIterator& it,                                      TObjectPtr obj) const{    it.Reset();    it.m_ContainerType = this;    it.m_ContainerPtr = obj;    return m_InitIterator(it);}inlinevoid CContainerTypeInfo::ReleaseIterator(CIterator& it) const{    _ASSERT(it.m_ContainerType == this);    m_ReleaseIterator(it);}inlinevoid CContainerTypeInfo::CopyIterator(CIterator& dst,                                      const CIterator& src) const{    _ASSERT(src.m_ContainerType == this);    dst.Reset();    dst.m_ContainerType = this;    m_CopyIterator(dst, src);}inlinebool CContainerTypeInfo::NextElement(CIterator& it) const{    _ASSERT(it.m_ContainerType == this);    return m_NextElement(it);}inlineTObjectPtr CContainerTypeInfo::GetElementPtr(const CIterator& it) const{    _ASSERT(it.m_ContainerType == this);    return m_GetElementPtr(it);}inlinebool CContainerTypeInfo::EraseElement(CIterator& it) const{    _ASSERT(it.m_ContainerType == this);    return m_EraseElement(it);}inlinevoid CContainerTypeInfo::EraseAllElements(CIterator& it) const{    _ASSERT(it.m_ContainerType == this);    m_EraseAllElements(it);}inlinevoid CContainerTypeInfo::AddElement(TObjectPtr containerPtr,                                    TConstObjectPtr elementPtr,                                    ESerialRecursionMode how) const{    m_AddElement(this, containerPtr, elementPtr, how);}inlinevoid CContainerTypeInfo::AddElement(TObjectPtr containerPtr,                                    CObjectIStream& in) const{    m_AddElementIn(this, containerPtr, in);}inlineCContainerElementIterator::CContainerElementIterator(void)    : m_ElementType(0), m_Valid(false){}inlineCContainerElementIterator::CContainerElementIterator(TObjectPtr containerPtr,                                                     const CContainerTypeInfo* containerType)    : m_ElementType(containerType->GetElementType()){    m_Valid = containerType->InitIterator(m_Iterator, containerPtr);}inlineCContainerElementIterator::CContainerElementIterator(const CContainerElementIterator& src)    : m_ElementType(src.m_ElementType),      m_Valid(src.m_Valid){    const CContainerTypeInfo* containerType =        src.m_Iterator.GetContainerType();    if ( containerType )        containerType->CopyIterator(m_Iterator, src.m_Iterator);}inlineCContainerElementIterator& CContainerElementIterator::operator=(const CContainerElementIterator& src){    m_Valid = false;    m_Iterator.Reset();    m_ElementType = src.m_ElementType;    const CContainerTypeInfo* containerType =        src.m_Iterator.GetContainerType();    if ( containerType )        containerType->CopyIterator(m_Iterator, src.m_Iterator);    m_Valid = src.m_Valid;    return *this;}inlinevoid CContainerElementIterator::Init(TObjectPtr containerPtr,                                     const CContainerTypeInfo* containerType){    m_Valid = false;    m_Iterator.Reset();    m_ElementType = containerType->GetElementType();    m_Valid = containerType->InitIterator(m_Iterator, containerPtr);}inlineTTypeInfo CContainerElementIterator::GetElementType(void) const{    return m_ElementType;}inlinebool CContainerElementIterator::Valid(void) const{    return m_Valid;}inlinevoid CContainerElementIterator::Next(void){    _ASSERT(m_Valid);    m_Valid = m_Iterator.GetContainerType()->NextElement(m_Iterator);}inlinevoid CContainerElementIterator::Erase(void){    _ASSERT(m_Valid);    m_Valid = m_Iterator.GetContainerType()->EraseElement(m_Iterator);}inlinevoid CContainerElementIterator::EraseAll(void){    if ( m_Valid ) {        m_Iterator.GetContainerType()->EraseAllElements(m_Iterator);        m_Valid = false;    }}inlinepair<TObjectPtr, TTypeInfo> CContainerElementIterator::Get(void) const{    _ASSERT(m_Valid);    return make_pair(m_Iterator.GetContainerType()->GetElementPtr(m_Iterator),                     GetElementType());}inlineCConstContainerElementIterator::CConstContainerElementIterator(void)    : m_ElementType(0), m_Valid(false){}inlineCConstContainerElementIterator::CConstContainerElementIterator(TConstObjectPtr containerPtr,                                                               const CContainerTypeInfo* containerType)    : m_ElementType(containerType->GetElementType()){    m_Valid = containerType->InitIterator(m_Iterator, containerPtr);}inlineCConstContainerElementIterator::CConstContainerElementIterator(const CConstContainerElementIterator& src)    : m_ElementType(src.m_ElementType),      m_Valid(src.m_Valid){    const CContainerTypeInfo* containerType =        src.m_Iterator.GetContainerType();    if ( containerType )        containerType->CopyIterator(m_Iterator, src.m_Iterator);}inlineCConstContainerElementIterator&CConstContainerElementIterator::operator=(const CConstContainerElementIterator& src){    m_Valid = false;    m_Iterator.Reset();    m_ElementType = src.m_ElementType;    const CContainerTypeInfo* containerType =        src.m_Iterator.GetContainerType();    if ( containerType )        containerType->CopyIterator(m_Iterator, src.m_Iterator);    m_Valid = src.m_Valid;    return *this;}inlinevoid CConstContainerElementIterator::Init(TConstObjectPtr containerPtr,                                          const CContainerTypeInfo* containerType){    m_Valid = false;    m_Iterator.Reset();    m_ElementType = containerType->GetElementType();    m_Valid = containerType->InitIterator(m_Iterator, containerPtr);}inlineTTypeInfo CConstContainerElementIterator::GetElementType(void) const{    return m_ElementType;}inlinebool CConstContainerElementIterator::Valid(void) const{    return m_Valid;}inlinevoid CConstContainerElementIterator::Next(void){    _ASSERT(m_Valid);    m_Valid = m_Iterator.GetContainerType()->NextElement(m_Iterator);}inlinepair<TConstObjectPtr, TTypeInfo> CConstContainerElementIterator::Get(void) const{    _ASSERT(m_Valid);    return make_pair(m_Iterator.GetContainerType()->GetElementPtr(m_Iterator),                     GetElementType());}#endif /* def CONTINFO__HPP  &&  ndef CONTINFO__INL *//* ---------------------------------------------------------------------------* $Log: continfo.inl,v $* Revision 1000.1  2004/04/12 17:14:33  gouriano* PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.5** Revision 1.5  2004/03/25 15:56:27  gouriano* Added possibility to copy and compare serial object non-recursively** Revision 1.4  2003/08/14 20:03:57  vasilche* Avoid memory reallocation when reading over preallocated object.* Simplified CContainerTypeInfo iterators interface.** Revision 1.3  2002/12/23 18:38:50  dicuccio* Added WIn32 export specifier: NCBI_XSERIAL_EXPORT.* Moved all CVS logs to the end.** Revision 1.2  2000/10/13 16:28:30  vasilche* Reduced header dependency.* Avoid use of templates with virtual methods.* Reduced amount of different maps used.* All this lead to smaller compiled code size (libraries and programs).** Revision 1.1  2000/09/18 20:00:00  vasilche* Separated CVariantInfo and CMemberInfo.* Implemented copy hooks.* All hooks now are stored in CTypeInfo/CMemberInfo/CVariantInfo.* Most type specific functions now are implemented via function pointers instead of virtual functions.** ===========================================================================*/

⌨️ 快捷键说明

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