📄 objectiter.inl
字号:
/* * =========================================================================== * PRODUCTION $Log: objectiter.inl,v $ * PRODUCTION Revision 1000.0 2003/10/29 17:25:36 gouriano * PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.6 * PRODUCTION * =========================================================================== */#if defined(OBJECTITER__HPP) && !defined(OBJECTITER__INL)#define OBJECTITER__INL/* $Id: objectiter.inl,v 1000.0 2003/10/29 17:25:36 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 !!!*//////////////////////////////////////////////////////////////////////////////// iterators/////////////////////////////////////////////////////////////////////////////// container interfaceinlineCConstObjectInfoEI::CConstObjectInfoEI(void){ _DEBUG_ARG(m_LastCall = eNone);}inlinebool CConstObjectInfoEI::CheckValid(void) const{#if _DEBUG if ( m_LastCall != eValid) ReportNonValid();#endif return m_Iterator.Valid();}inlinebool CConstObjectInfoEI::Valid(void) const{ _DEBUG_ARG(m_LastCall = eValid); return CheckValid();}inlineCConstObjectInfoEI::operator bool(void) const{ return Valid();}inlinebool CConstObjectInfoEI::operator!(void) const{ return !Valid();}inlinevoid CConstObjectInfoEI::Next(void){ _ASSERT(CheckValid()); m_Iterator.Next();}inlineCConstObjectInfoEI& CConstObjectInfoEI::operator++(void){ Next(); return *this;}inlineCConstObjectInfo CConstObjectInfoEI::GetElement(void) const{ _ASSERT(CheckValid()); return m_Iterator.Get();}inlineCConstObjectInfo CConstObjectInfoEI::operator*(void) const{ _ASSERT(CheckValid()); return m_Iterator.Get();}/*inlineCConstObjectInfo CConstObjectInfoEI::operator->(void) const{ _ASSERT(CheckValid()); return m_Iterator.Get();}*/inlineCObjectInfoEI::CObjectInfoEI(void){ _DEBUG_ARG(m_LastCall = eNone);}inlinebool CObjectInfoEI::CheckValid(void) const{#if _DEBUG if ( m_LastCall != eValid) ReportNonValid();#endif return m_Iterator.Valid();}inlinebool CObjectInfoEI::Valid(void) const{ _DEBUG_ARG(m_LastCall = eValid); return CheckValid();}inlineCObjectInfoEI::operator bool(void) const{ return Valid();}inlinebool CObjectInfoEI::operator!(void) const{ return !Valid();}inlinevoid CObjectInfoEI::Next(void){ _ASSERT(CheckValid()); _DEBUG_ARG(m_LastCall = eNext); m_Iterator.Next();}inlineCObjectInfoEI& CObjectInfoEI::operator++(void){ Next(); return *this;}inlineCObjectInfo CObjectInfoEI::GetElement(void) const{ _ASSERT(CheckValid()); return m_Iterator.Get();}inlineCObjectInfo CObjectInfoEI::operator*(void) const{ _ASSERT(CheckValid()); return m_Iterator.Get();}inlinevoid CObjectInfoEI::Erase(void){ _ASSERT(CheckValid()); _DEBUG_ARG(m_LastCall = eErase); m_Iterator.Erase();}// class interfaceinlineCObjectTypeInfoII::CObjectTypeInfoII(void) : m_ItemIndex(kFirstMemberIndex), m_LastItemIndex(kInvalidMember){ _DEBUG_ARG(m_LastCall = eNone);}inlinevoid CObjectTypeInfoII::Init(const CClassTypeInfoBase* typeInfo, TMemberIndex index){ m_OwnerType = typeInfo; m_ItemIndex = index; m_LastItemIndex = typeInfo->GetItems().LastIndex(); _DEBUG_ARG(m_LastCall = (index == kInvalidMember? eNone: eValid));}inlinevoid CObjectTypeInfoII::Init(const CClassTypeInfoBase* typeInfo){ Init(typeInfo, kFirstMemberIndex);}inlineCObjectTypeInfoII::CObjectTypeInfoII(const CClassTypeInfoBase* typeInfo){ Init(typeInfo);}inlineCObjectTypeInfoII::CObjectTypeInfoII(const CClassTypeInfoBase* typeInfo, TMemberIndex index){ Init(typeInfo, index);}inlineconst CObjectTypeInfo& CObjectTypeInfoII::GetOwnerType(void) const{ return m_OwnerType;}inlineconst CClassTypeInfoBase* CObjectTypeInfoII::GetClassTypeInfoBase(void) const{ return CTypeConverter<CClassTypeInfoBase>:: SafeCast(GetOwnerType().GetTypeInfo());}inlinebool CObjectTypeInfoII::CheckValid(void) const{#if _DEBUG if ( m_LastCall != eValid) ReportNonValid();#endif return m_ItemIndex >= kFirstMemberIndex && m_ItemIndex <= m_LastItemIndex;}inlineTMemberIndex CObjectTypeInfoII::GetItemIndex(void) const{ _ASSERT(CheckValid()); return m_ItemIndex;}inlineconst CItemInfo* CObjectTypeInfoII::GetItemInfo(void) const{ return GetClassTypeInfoBase()->GetItems().GetItemInfo(GetItemIndex());}inlineconst string& CObjectTypeInfoII::GetAlias(void) const{ return GetItemInfo()->GetId().GetName();}inlinebool CObjectTypeInfoII::Valid(void) const{ _DEBUG_ARG(m_LastCall = eValid); return CheckValid();}inlineCObjectTypeInfoII::operator bool(void) const{ return Valid();}inlinebool CObjectTypeInfoII::operator!(void) const{ return !Valid();}inlinevoid CObjectTypeInfoII::Next(void){ _ASSERT(CheckValid()); _DEBUG_ARG(m_LastCall = eNext); ++m_ItemIndex;}inlinebool CObjectTypeInfoII::operator==(const CObjectTypeInfoII& iter) const{ return GetOwnerType() == iter.GetOwnerType() && GetItemIndex() == iter.GetItemIndex();}inlinebool CObjectTypeInfoII::operator!=(const CObjectTypeInfoII& iter) const{ return GetOwnerType() != iter.GetOwnerType() || GetItemIndex() == iter.GetItemIndex();}// CObjectTypeInfoMI //////////////////////////////////////////////////////inlineCObjectTypeInfoMI::CObjectTypeInfoMI(void){}inlineCObjectTypeInfoMI::CObjectTypeInfoMI(const CObjectTypeInfo& info) : CParent(info.GetClassTypeInfo()){}inlineCObjectTypeInfoMI::CObjectTypeInfoMI(const CObjectTypeInfo& info, TMemberIndex index) : CParent(info.GetClassTypeInfo(), index){}inlineCObjectTypeInfoMI& CObjectTypeInfoMI::operator++(void){ Next(); return *this;}inlinevoid CObjectTypeInfoMI::Init(const CObjectTypeInfo& info){ CParent::Init(info.GetClassTypeInfo());}inlinevoid CObjectTypeInfoMI::Init(const CObjectTypeInfo& info, TMemberIndex index){ CParent::Init(info.GetClassTypeInfo(), index);}inlineCObjectTypeInfoMI& CObjectTypeInfoMI::operator=(const CObjectTypeInfo& info){ Init(info); return *this;}inlineconst CClassTypeInfo* CObjectTypeInfoMI::GetClassTypeInfo(void) const{ return GetOwnerType().GetClassTypeInfo();}inlineCObjectTypeInfo CObjectTypeInfoMI::GetClassType(void) const{ return GetOwnerType();}inlineTMemberIndex CObjectTypeInfoMI::GetMemberIndex(void) const{ return GetItemIndex();}inlineconst CMemberInfo* CObjectTypeInfoMI::GetMemberInfo(void) const{ return GetClassTypeInfo()->GetMemberInfo(GetMemberIndex());}inlineCMemberInfo* CObjectTypeInfoMI::GetNCMemberInfo(void) const{ return const_cast<CMemberInfo*>(GetMemberInfo());}inlineCObjectTypeInfoMI::operator CObjectTypeInfo(void) const{ return GetMemberInfo()->GetTypeInfo();}inlineCObjectTypeInfo CObjectTypeInfoMI::GetMemberType(void) const{ return GetMemberInfo()->GetTypeInfo();}inlineCObjectTypeInfo CObjectTypeInfoMI::operator*(void) const{ return GetMemberInfo()->GetTypeInfo();}// CObjectTypeInfoVI //////////////////////////////////////////////////////inlineCObjectTypeInfoVI::CObjectTypeInfoVI(const CObjectTypeInfo& info) : CParent(info.GetChoiceTypeInfo()){}inlineCObjectTypeInfoVI::CObjectTypeInfoVI(const CObjectTypeInfo& info, TMemberIndex index) : CParent(info.GetChoiceTypeInfo(), index){}inlineCObjectTypeInfoVI& CObjectTypeInfoVI::operator++(void){ Next(); return *this;}inlinevoid CObjectTypeInfoVI::Init(const CObjectTypeInfo& info){ CParent::Init(info.GetChoiceTypeInfo());}inlinevoid CObjectTypeInfoVI::Init(const CObjectTypeInfo& info, TMemberIndex index){ CParent::Init(info.GetChoiceTypeInfo(), index);}inlineCObjectTypeInfoVI& CObjectTypeInfoVI::operator=(const CObjectTypeInfo& info){ Init(info); return *this;}inlineconst CChoiceTypeInfo* CObjectTypeInfoVI::GetChoiceTypeInfo(void) const{ return GetOwnerType().GetChoiceTypeInfo();}inlineCObjectTypeInfo CObjectTypeInfoVI::GetChoiceType(void) const{ return GetOwnerType();}inlineTMemberIndex CObjectTypeInfoVI::GetVariantIndex(void) const{ return GetItemIndex();}inlineconst CVariantInfo* CObjectTypeInfoVI::GetVariantInfo(void) const{ return GetChoiceTypeInfo()->GetVariantInfo(GetVariantIndex());}inlineCVariantInfo* CObjectTypeInfoVI::GetNCVariantInfo(void) const{ return const_cast<CVariantInfo*>(GetVariantInfo());}inlineCObjectTypeInfo CObjectTypeInfoVI::GetVariantType(void) const{ return GetVariantInfo()->GetTypeInfo();}inlineCObjectTypeInfo CObjectTypeInfoVI::operator*(void) const{ return GetVariantInfo()->GetTypeInfo();}// CConstObjectInfoMI //////////////////////////////////////////////////////inlineCConstObjectInfoMI::CConstObjectInfoMI(void){}inlineCConstObjectInfoMI::CConstObjectInfoMI(const CConstObjectInfo& object) : CParent(object), m_Object(object){ _ASSERT(object);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -