ishi_cache.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:4k
- /*
- * ===========================================================================
- * PRODUCTION $Log: ishi_cache.hpp,v $
- * PRODUCTION Revision 1000.0 2004/06/01 21:27:30 gouriano
- * PRODUCTION PRODUCTION: IMPORTED [GCC34_MSVC7] Dev-tree R1.1
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGETS_GRAPH_3D___ISHI_CACHE__HPP
- #define GUI_WIDGETS_GRAPH_3D___ISHI_CACHE__HPP
- /* $Id: ishi_cache.hpp,v 1000.0 2004/06/01 21:27:30 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.
- *
- * ===========================================================================
- *
- * Authors: Vladimir Tereshkov
- *
- * File Description:
- * Interface to deal with Taxplot Data cache.
- */
- #include <corelib/ncbistd.hpp>
- #include <serial/serialbase.hpp>
- #include <serial/stdtypes.hpp>
- #include <corelib/ncbi_bswap.hpp>
- #include <serial/serialimpl.hpp>
- BEGIN_NCBI_SCOPE
- class IShiCache
- {
- public:
- // simplified cache
- typedef map<int, int> TScoreMap; // tax&score vect for 1 gi
- typedef vector<TScoreMap> TIdVector; // all cachable gi's
- virtual ~IShiCache() { }
- virtual void CreateCache(CNcbiIfstream & str) = 0;
- virtual const TIdVector & GetData(void) = 0;
- };
- // data object
- class CShiReaderCache : public CSerialObject, public IShiCache
- {
- public:
- CShiReaderCache(string name = "")
- : m_Name(name)
- {
- m_Cache.clear();
- }
- ~CShiReaderCache()
- {
- m_Cache.clear();
- }
- virtual void CreateCache(CNcbiIfstream & str);
-
-
- const TIdVector & GetData(void)
- {
- return m_Cache;
- }
- DECLARE_INTERNAL_TYPE_INFO();
- private:
- string m_Name;
- IShiCache::TIdVector m_Cache;
- Int4 x_GetNextInt(Uchar * buff, CT_OFF_TYPE & pos);
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: ishi_cache.hpp,v $
- * Revision 1000.0 2004/06/01 21:27:30 gouriano
- * PRODUCTION: IMPORTED [GCC34_MSVC7] Dev-tree R1.1
- *
- * Revision 1.1 2004/05/20 21:38:31 tereshko
- * Moved artificial serial object to only one user - viewer
- *
- * Revision 1.4 2004/02/20 20:03:27 ucko
- * Fix to compile with stricter implementations of CT_POS_TYPE
- *
- * Revision 1.3 2004/01/21 14:16:29 dicuccio
- * Adjusted API to be more coding standard compliant.
- *
- * Revision 1.2 2004/01/15 13:09:09 ucko
- * Use CT_POS_TYPE macro rather than pos_type typedef, which GCC 2.95 lacks.
- *
- * Revision 1.1 2004/01/14 19:43:58 tereshko
- * Added Taxplot viewer with corresponding widget
- *
- * Revision 1.1 2004/01/05 16:22:03 tereshko
- * Initial revision
- *
- * ===========================================================================
- */
- #endif