Files
envi-code/SourceCode/Code2026/AdsXRx/Groups.cpp
T
2026-09-28 15:28:50 +08:00

52 lines
1.2 KiB
C++

//-------------------------------------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : Groups Àà
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: Groups ¶¨Òå
// = Maintainers:
//
//-------------------------------------------------------------------------------------------------------+
#include "StdAfx.h"
#include "Groups.h"
#include "XPoint.h"
#include "XGlobalFunc.h"
Groups::~Groups()
{
}
int Groups::operator == (const Groups &other) const
{
if (type != other.type)
{
return 0;
}
switch(TypeOfCode(code))
{
case RTSTR : return !_tcsicmp(string,other.string);
case RTANG:
case RTREAL : return fabs(real-other.real) < 1E-8;
case RTSHORT : return shortInt == other.shortInt;
case RTLONG : return longInt == other.longInt;
case RTENAME :
case RTPICKS : return ads_name_equal(adsName, other.adsName);
case RTPOINT :
case RT3DPOINT: return *(XPoint *)point == *(XPoint *)other.point;
}
return 0;
}
inline Groups& Groups::operator = (const Groups &src)
{
memcpy(this, &src, sizeof(Groups));
if(TypeOfCode(code) == RTSTR)
{
string = _tcsdup(src.string);
}
return *this;
}