#include <LINK/basic/ElementOps.h>

#include <LINK/userobj/Testobj.h>
#include <LINK/algorithm/AnimationData.h>

typedef AnimationData*  _AnimationDatap;
typedef ElementOps<AnimationData*  > _ElementOps_AnimationDatap_;

int ElementOps<_AnimationDatap>::compareItems(const _AnimationDatap& e1, const _AnimationDatap& e2);
ostream& ElementOps<_AnimationDatap>::displayItem(ostream& os, const _AnimationDatap& e);

void lion()
{
	int li;
	li = 5;
}

template class ElementOps<AnimationData*  >;
//*********************************************************************
int ElementOps<_AnimationDatap>::compareItems(const _AnimationDatap& e1, const _AnimationDatap& e2)
{
	lion();
        if (e1 && e2)  {
                if (*e1 == *e2)
                        return 0;
                else
                        return (*e1<*e2)? -1 : 1;
        } else {
                if (e1 == e2)
                        return 0;
                else
                        return (e1<e2)? -1 : 1;
        }
}
ostream& ElementOps<_AnimationDatap>::displayItem(ostream& os, const _AnimationDatap& e)
{
        if (e)
                os << *e;
        else
                os << e;
        return os;
}
//*********************************************************************



typedef Testobj*  _Testobjp;
typedef ElementOps<Testobj*  > _ElementOps_Testobjp_;


//*********************************************************************
int ElementOps<_Testobjp>::compareItems(const _Testobjp& e1, const _Testobjp& e2); 
ostream& ElementOps<_Testobjp>::displayItem(ostream& os, const _Testobjp& e);

template class ElementOps<Testobj*  >;



//*********************************************************************
int ElementOps<_Testobjp>::compareItems(const _Testobjp& e1, const _Testobjp& e2) 
{
	if (e1 && e2)  {
		if (*e1 == *e2)
			return 0;
		else
			return (*e1<*e2)? -1 : 1;
	} else {
		if (e1 == e2)
			return 0;
		else
			return (e1<e2)? -1 : 1;
	}
}

ostream& ElementOps<_Testobjp>::displayItem(ostream& os, const _Testobjp& e)
{
	if (e)
		os << *e;
	else
		os << e;
	return os;
}
//*********************************************************************
