/*==========================================================================*/
/* Copyright (c) 1999 - Sykes Enterprises Inc. - All rights reserved        */
/*--------------------------------------------------------------------------*/
/* Sykes grants you ("Licensee") a non-exclusive, royalty free, license to  */
/* use, modify and redistribute this software in source and binary code     */
/* form, provided that i) this copyright notice and license appear on all   */
/* copies of the software; and ii) Licensee does not utilize the software   */
/* in a manner which is disparaging to Sykes.                               */
/*                                                                          */
/* This software is provided "AS IS", without a warranty of any kind. ALL   */
/* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING */
/* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR        */
/* PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SYKES AND ITS          */
/* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A  */
/* RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS           */
/* DERIVATIVES. IN NO EVENT WILL SYKES OR ITS LICENSORS BE LIABLE FOR ANY   */
/* LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,          */
/* CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND        */
/* REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR      */
/* INABILITY TO USE SOFTWARE, EVEN IF SYKES HAS BEEN ADVISED OF THE         */
/* POSSIBILITY OF SUCH DAMAGES.                                             */
/*==========================================================================*/

#ifndef __OKLITETMRESULT_H
#define __OKLITETMRESULT_H

#pragma warning(disable:4786)

#include <stdlib.h>
#include <list>
#include <string>

using namespace std;


/*--------------------------------------------------------------------------*/

class okLiteTMResult
{
public:

	/// Constructor
	okLiteTMResult ()
		{};

	/// Destructor
	~okLiteTMResult ()
		{};

	// >= and < are the only operators needed in this implementation
	// We handle == by comparing the length of the keys to have shorter
	// first, this will give us match with equal score correctly ordered

	bool operator>=(okLiteTMResult& p_rData) const
	{
		if ( m_fScore > p_rData.m_fScore ) return(true);
		else if ( m_fScore < p_rData.m_fScore ) return(false);
		else return(m_nLen <= p_rData.m_nLen); };

	bool operator<(okLiteTMResult& p_rData) const
	{
		if ( m_fScore < p_rData.m_fScore ) return(true);
		else if ( m_fScore > p_rData.m_fScore ) return(false);
		else return(m_nLen > p_rData.m_nLen); };


public:

	float                m_fScore;
	long                 m_lPos;
	int                  m_nLen;
};


typedef list<okLiteTMResult>           okLiteTMResultList;
typedef okLiteTMResultList::iterator   okLiteTMResultIter;


#endif // __OKLITETMRESULT_H


