Query_Search_.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:9k
- /*
- * ===========================================================================
- * PRODUCTION $Log: Query_Search_.hpp,v $
- * PRODUCTION Revision 1000.1 2004/04/12 17:20:26 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.5
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: Query_Search_.hpp,v 1000.1 2004/04/12 17:20:26 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.
- *
- * ===========================================================================
- *
- * File Description:
- * This code is generated by application DATATOOL
- * using specifications from the data definition file
- * 'twebenv.asn'.
- *
- * ATTENTION:
- * Don't edit or check-in this file to the CVS as this file will
- * be overridden (by DATATOOL) without warning!
- * ===========================================================================
- */
- #ifndef QUERY_SEARCH_BASE_HPP
- #define QUERY_SEARCH_BASE_HPP
- // standard includes
- #include <serial/serialbase.hpp>
- // generated includes
- #include <list>
- #include <string>
- // forward declarations
- class CFilter_Value;
- // generated classes
- class CQuery_Search_Base : public ncbi::CSerialObject
- {
- typedef ncbi::CSerialObject Tparent;
- public:
- // constructor
- CQuery_Search_Base(void);
- // destructor
- virtual ~CQuery_Search_Base(void);
- // type info
- DECLARE_INTERNAL_TYPE_INFO();
- // types
- typedef std::string TDb;
- typedef std::string TTerm;
- typedef std::string TField;
- typedef std::list< ncbi::CRef< CFilter_Value > > TFilters;
- typedef int TCount;
- typedef int TFlags;
- // getters
- // setters
- // mandatory
- // typedef std::string TDb
- bool IsSetDb(void) const;
- bool CanGetDb(void) const;
- void ResetDb(void);
- const TDb& GetDb(void) const;
- void SetDb(const TDb& value);
- TDb& SetDb(void);
- // mandatory
- // typedef std::string TTerm
- bool IsSetTerm(void) const;
- bool CanGetTerm(void) const;
- void ResetTerm(void);
- const TTerm& GetTerm(void) const;
- void SetTerm(const TTerm& value);
- TTerm& SetTerm(void);
- // optional
- // typedef std::string TField
- bool IsSetField(void) const;
- bool CanGetField(void) const;
- void ResetField(void);
- const TField& GetField(void) const;
- void SetField(const TField& value);
- TField& SetField(void);
- // optional
- // typedef std::list< ncbi::CRef< CFilter_Value > > TFilters
- bool IsSetFilters(void) const;
- bool CanGetFilters(void) const;
- void ResetFilters(void);
- const TFilters& GetFilters(void) const;
- TFilters& SetFilters(void);
- // mandatory
- // typedef int TCount
- bool IsSetCount(void) const;
- bool CanGetCount(void) const;
- void ResetCount(void);
- TCount GetCount(void) const;
- void SetCount(const TCount& value);
- TCount& SetCount(void);
- // optional
- // typedef int TFlags
- bool IsSetFlags(void) const;
- bool CanGetFlags(void) const;
- void ResetFlags(void);
- TFlags GetFlags(void) const;
- void SetFlags(const TFlags& value);
- TFlags& SetFlags(void);
- // reset whole object
- virtual void Reset(void);
- private:
- // Prohibit copy constructor and assignment operator
- CQuery_Search_Base(const CQuery_Search_Base&);
- CQuery_Search_Base& operator=(const CQuery_Search_Base&);
- // data
- Uint4 m_set_State[1];
- TDb m_Db;
- TTerm m_Term;
- TField m_Field;
- TFilters m_Filters;
- TCount m_Count;
- TFlags m_Flags;
- };
- ///////////////////////////////////////////////////////////
- ///////////////////// inline methods //////////////////////
- ///////////////////////////////////////////////////////////
- inline
- bool CQuery_Search_Base::IsSetDb(void) const
- {
- return ((m_set_State[0] & 0x3) != 0);
- }
- inline
- bool CQuery_Search_Base::CanGetDb(void) const
- {
- return IsSetDb();
- }
- inline
- const std::string& CQuery_Search_Base::GetDb(void) const
- {
- if (!CanGetDb()) {
- ThrowUnassigned(0);
- }
- return m_Db;
- }
- inline
- void CQuery_Search_Base::SetDb(const std::string& value)
- {
- m_Db = value;
- m_set_State[0] |= 0x3;
- }
- inline
- std::string& CQuery_Search_Base::SetDb(void)
- {
- #ifdef _DEBUG
- if (!IsSetDb()) {
- m_Db = ms_UnassignedStr;
- }
- #endif
- m_set_State[0] |= 0x1;
- return m_Db;
- }
- inline
- bool CQuery_Search_Base::IsSetTerm(void) const
- {
- return ((m_set_State[0] & 0xc) != 0);
- }
- inline
- bool CQuery_Search_Base::CanGetTerm(void) const
- {
- return IsSetTerm();
- }
- inline
- const std::string& CQuery_Search_Base::GetTerm(void) const
- {
- if (!CanGetTerm()) {
- ThrowUnassigned(1);
- }
- return m_Term;
- }
- inline
- void CQuery_Search_Base::SetTerm(const std::string& value)
- {
- m_Term = value;
- m_set_State[0] |= 0xc;
- }
- inline
- std::string& CQuery_Search_Base::SetTerm(void)
- {
- #ifdef _DEBUG
- if (!IsSetTerm()) {
- m_Term = ms_UnassignedStr;
- }
- #endif
- m_set_State[0] |= 0x4;
- return m_Term;
- }
- inline
- bool CQuery_Search_Base::IsSetField(void) const
- {
- return ((m_set_State[0] & 0x30) != 0);
- }
- inline
- bool CQuery_Search_Base::CanGetField(void) const
- {
- return IsSetField();
- }
- inline
- const std::string& CQuery_Search_Base::GetField(void) const
- {
- if (!CanGetField()) {
- ThrowUnassigned(2);
- }
- return m_Field;
- }
- inline
- void CQuery_Search_Base::SetField(const std::string& value)
- {
- m_Field = value;
- m_set_State[0] |= 0x30;
- }
- inline
- std::string& CQuery_Search_Base::SetField(void)
- {
- #ifdef _DEBUG
- if (!IsSetField()) {
- m_Field = ms_UnassignedStr;
- }
- #endif
- m_set_State[0] |= 0x10;
- return m_Field;
- }
- inline
- bool CQuery_Search_Base::IsSetFilters(void) const
- {
- return ((m_set_State[0] & 0xc0) != 0);
- }
- inline
- bool CQuery_Search_Base::CanGetFilters(void) const
- {
- return true;
- }
- inline
- const std::list< ncbi::CRef< CFilter_Value > >& CQuery_Search_Base::GetFilters(void) const
- {
- return m_Filters;
- }
- inline
- std::list< ncbi::CRef< CFilter_Value > >& CQuery_Search_Base::SetFilters(void)
- {
- m_set_State[0] |= 0x40;
- return m_Filters;
- }
- inline
- bool CQuery_Search_Base::IsSetCount(void) const
- {
- return ((m_set_State[0] & 0x300) != 0);
- }
- inline
- bool CQuery_Search_Base::CanGetCount(void) const
- {
- return IsSetCount();
- }
- inline
- void CQuery_Search_Base::ResetCount(void)
- {
- m_Count = 0;
- m_set_State[0] &= ~0x300;
- }
- inline
- int CQuery_Search_Base::GetCount(void) const
- {
- if (!CanGetCount()) {
- ThrowUnassigned(4);
- }
- return m_Count;
- }
- inline
- void CQuery_Search_Base::SetCount(const int& value)
- {
- m_Count = value;
- m_set_State[0] |= 0x300;
- }
- inline
- int& CQuery_Search_Base::SetCount(void)
- {
- #ifdef _DEBUG
- if (!IsSetCount()) {
- memset(&m_Count,ms_UnassignedByte,sizeof(m_Count));
- }
- #endif
- m_set_State[0] |= 0x100;
- return m_Count;
- }
- inline
- bool CQuery_Search_Base::IsSetFlags(void) const
- {
- return ((m_set_State[0] & 0xc00) != 0);
- }
- inline
- bool CQuery_Search_Base::CanGetFlags(void) const
- {
- return IsSetFlags();
- }
- inline
- void CQuery_Search_Base::ResetFlags(void)
- {
- m_Flags = 0;
- m_set_State[0] &= ~0xc00;
- }
- inline
- int CQuery_Search_Base::GetFlags(void) const
- {
- if (!CanGetFlags()) {
- ThrowUnassigned(5);
- }
- return m_Flags;
- }
- inline
- void CQuery_Search_Base::SetFlags(const int& value)
- {
- m_Flags = value;
- m_set_State[0] |= 0xc00;
- }
- inline
- int& CQuery_Search_Base::SetFlags(void)
- {
- #ifdef _DEBUG
- if (!IsSetFlags()) {
- memset(&m_Flags,ms_UnassignedByte,sizeof(m_Flags));
- }
- #endif
- m_set_State[0] |= 0x400;
- return m_Flags;
- }
- ///////////////////////////////////////////////////////////
- ////////////////// end of inline methods //////////////////
- ///////////////////////////////////////////////////////////
- #endif // QUERY_SEARCH_BASE_HPP