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

📄 objectinfo.inl

📁 ncbi源码
💻 INL
字号:
/* * =========================================================================== * PRODUCTION $Log: objectinfo.inl,v $ * PRODUCTION Revision 1000.2  2003/12/02 20:32:43  gouriano * PRODUCTION PRODUCTION: UPGRADED [ORIGINAL] Dev-tree R1.5 * PRODUCTION * =========================================================================== */#if defined(OBJECTINFO__HPP)  &&  !defined(OBJECTINFO__INL)#define OBJECTINFO__INL/*  $Id: objectinfo.inl,v 1000.2 2003/12/02 20:32:43 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 !!!*//////////////////////////////////////////////////////////////////////////////// CObjectTypeInfo/////////////////////////////////////////////////////////////////////////////inlineCObjectTypeInfo::CObjectTypeInfo(TTypeInfo typeinfo)    : m_TypeInfo(typeinfo){}inlineTTypeInfo CObjectTypeInfo::GetTypeInfo(void) const{    return m_TypeInfo;}inlineCTypeInfo* CObjectTypeInfo::GetNCTypeInfo(void) const{    return const_cast<CTypeInfo*>(GetTypeInfo());}inlineETypeFamily CObjectTypeInfo::GetTypeFamily(void) const{    return GetTypeInfo()->GetTypeFamily();}inlinevoid CObjectTypeInfo::CheckTypeFamily(ETypeFamily family) const{    if ( GetTypeInfo()->GetTypeFamily() != family )        WrongTypeFamily(family);}inlinevoid CObjectTypeInfo::ResetTypeInfo(void){    m_TypeInfo = 0;}inlinevoid CObjectTypeInfo::SetTypeInfo(TTypeInfo typeinfo){    m_TypeInfo = typeinfo;}inlinebool CObjectTypeInfo::Valid(void) const{    return m_TypeInfo != 0;}inlineCObjectTypeInfo::operator bool(void) const{    return Valid();}inlinebool CObjectTypeInfo::operator!(void) const{    return !Valid();}inlinebool CObjectTypeInfo::operator==(const CObjectTypeInfo& type) const{    return GetTypeInfo() == type.GetTypeInfo();}inlinebool CObjectTypeInfo::operator!=(const CObjectTypeInfo& type) const{    return GetTypeInfo() != type.GetTypeInfo();}/////////////////////////////////////////////////////////////////////////////// CConstObjectInfo/////////////////////////////////////////////////////////////////////////////inlineCConstObjectInfo::CConstObjectInfo(void)    : m_ObjectPtr(0){}inlineCConstObjectInfo::CConstObjectInfo(TConstObjectPtr objectPtr,                                   TTypeInfo typeInfo)    : CObjectTypeInfo(typeInfo), m_ObjectPtr(objectPtr),      m_Ref(typeInfo->GetCObjectPtr(objectPtr)){}inlineCConstObjectInfo::CConstObjectInfo(TConstObjectPtr objectPtr,                                   TTypeInfo typeInfo,                                   ENonCObject)    : CObjectTypeInfo(typeInfo), m_ObjectPtr(objectPtr){    _ASSERT(!typeInfo->IsCObject() ||            static_cast<const CObject*>(objectPtr)->Referenced() ||            !static_cast<const CObject*>(objectPtr)->CanBeDeleted());}inlineCConstObjectInfo::CConstObjectInfo(pair<TConstObjectPtr, TTypeInfo> object)    : CObjectTypeInfo(object.second), m_ObjectPtr(object.first),      m_Ref(object.second->GetCObjectPtr(object.first)){}inlineCConstObjectInfo::CConstObjectInfo(pair<TObjectPtr, TTypeInfo> object)    : CObjectTypeInfo(object.second), m_ObjectPtr(object.first),      m_Ref(object.second->GetCObjectPtr(object.first)){}inlinebool CConstObjectInfo::Valid(void) const{    return m_ObjectPtr != 0;}inlineCConstObjectInfo::operator bool(void) const{    return Valid();}inlinebool CConstObjectInfo::operator!(void) const{    return !Valid();}inlinevoid CConstObjectInfo::ResetObjectPtr(void){    m_ObjectPtr = 0;    m_Ref.Reset();}inlineTConstObjectPtr CConstObjectInfo::GetObjectPtr(void) const{    return m_ObjectPtr;}inlinepair<TConstObjectPtr, TTypeInfo> CConstObjectInfo::GetPair(void) const{    return make_pair(GetObjectPtr(), GetTypeInfo());}inlinevoid CConstObjectInfo::Reset(void){    ResetObjectPtr();    ResetTypeInfo();}inlinevoid CConstObjectInfo::Set(TConstObjectPtr objectPtr, TTypeInfo typeInfo){    m_ObjectPtr = objectPtr;    SetTypeInfo(typeInfo);    m_Ref.Reset(typeInfo->GetCObjectPtr(objectPtr));}inlineCConstObjectInfo&CConstObjectInfo::operator=(pair<TConstObjectPtr, TTypeInfo> object){    Set(object.first, object.second);    return *this;}inlineCConstObjectInfo&CConstObjectInfo::operator=(pair<TObjectPtr, TTypeInfo> object){    Set(object.first, object.second);    return *this;}/////////////////////////////////////////////////////////////////////////////// CObjectInfo/////////////////////////////////////////////////////////////////////////////inlineCObjectInfo::CObjectInfo(void){}inlineCObjectInfo::CObjectInfo(TTypeInfo typeInfo)    : CParent(typeInfo->Create(), typeInfo){}inlineCObjectInfo::CObjectInfo(TObjectPtr objectPtr, TTypeInfo typeInfo)    : CParent(objectPtr, typeInfo){}inlineCObjectInfo::CObjectInfo(TObjectPtr objectPtr,                         TTypeInfo typeInfo,                         ENonCObject nonCObject)    : CParent(objectPtr, typeInfo, nonCObject){}inlineCObjectInfo::CObjectInfo(pair<TObjectPtr, TTypeInfo> object)    : CParent(object){}inlineTObjectPtr CObjectInfo::GetObjectPtr(void) const{    return const_cast<TObjectPtr>(CParent::GetObjectPtr());}inlinepair<TObjectPtr, TTypeInfo> CObjectInfo::GetPair(void) const{    return make_pair(GetObjectPtr(), GetTypeInfo());}inlineCObjectInfo&CObjectInfo::operator=(pair<TObjectPtr, TTypeInfo> object){    Set(object.first, object.second);    return *this;}#endif /* def OBJECTINFO__HPP  &&  ndef OBJECTINFO__INL *//* ---------------------------------------------------------------------------* $Log: objectinfo.inl,v $* Revision 1000.2  2003/12/02 20:32:43  gouriano* PRODUCTION: UPGRADED [ORIGINAL] Dev-tree R1.5** Revision 1.5  2003/11/24 14:10:04  grichenk* Changed base class for CAliasTypeInfo to CPointerTypeInfo** Revision 1.4  2003/11/18 18:11:47  grichenk* Resolve aliased type info before using it in CObjectTypeInfo** Revision 1.3  2002/12/23 18:38:51  dicuccio* Added WIn32 export specifier: NCBI_XSERIAL_EXPORT.* Moved all CVS logs to the end.** Revision 1.2  2001/05/17 14:57:22  lavr* Typos corrected** Revision 1.1  2000/10/20 15:51:24  vasilche* Fixed data error processing.* Added interface for constructing container objects directly into output stream.* object.hpp, object.inl and object.cpp were split to* objectinfo.*, objecttype.*, objectiter.* and objectio.*.** ===========================================================================*/

⌨️ 快捷键说明

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