This commit is contained in:
2025-02-27 18:19:30 +03:30
parent c94bfb2678
commit 09069165f0
6 changed files with 3072 additions and 285 deletions
+16 -8
View File
@@ -1805,10 +1805,14 @@ int GetLowest(
return result;
}
//
//
//
/**
* Get Oldest Box Index ...
* Get Oldest Index ...
*
* @param source: XBoxZone instance Reference Collection ...
* @param source: XConsolidationZone instance Reference Collection ...
*
* @return ( int )
*/
@@ -1868,9 +1872,9 @@ int GetOldest(
}
/**
* Get Youngest Box Index ...
* Get Youngest Index ...
*
* @param source: XBoxZone instance Reference Collection ...
* @param source: XConsolidationZone instance Reference Collection ...
*
* @return ( int )
*/
@@ -1930,9 +1934,9 @@ int GetYoungest(
}
/**
* Get Highest Box Index ...
* Get Highest Index ...
*
* @param source: XBoxZone instance Reference Collection ...
* @param source: XConsolidationZone instance Reference Collection ...
*
* @return ( int )
*/
@@ -1992,9 +1996,9 @@ int GetHighest(
}
/**
* Get Lowest Box Index ...
* Get Lowest Index ...
*
* @param source: XBoxZone instance Reference Collection ...
* @param source: XConsolidationZone instance Reference Collection ...
*
* @return ( int )
*/
@@ -2053,6 +2057,10 @@ int GetLowest(
return result;
}
//
//
//
//
template <typename T>
void SortZones(
+341
View File
@@ -3857,6 +3857,16 @@ int ExtractOBFVGs(
return result;
}
//
// Extensions Functions ...
//
/**
* Update to Time of Specifiex Collection ...
*
* @param items: XOBFVG instance Collection ...
* @param value: datetime ...
*/
void SpecifiedUpdateTo(
XOBFVG &items[],
datetime value = NULL //
@@ -3880,4 +3890,335 @@ void SpecifiedUpdateTo(
}
}
/**
* Converts to XBoxZone ...
*
* @return ( bool )
*/
bool ToBox(
XBoxZone &box,
XOBFVG &item //
)
{
//
bool result = false;
//
result = ToBox(
box,
item.ob //
);
//
return result;
}
/**
* Converts to XBoxZone ...
*
* @return ( bool )
*/
int ToBox(
XOBFVG &source[],
XBoxZone &dest[] //
)
{
//
int result = 0;
//
Clean(dest);
int count = ArraySize(source);
if (!IsValidSize(count))
{
return result;
}
//
for (int i = 0; i < count; i++)
{
//
XOBFVG iZone = source[i];
//
XBoxZone iBox;
bool hasBox = ToBox(
iBox,
iZone //
);
//
if (hasBox)
{
//
AddRef(
iBox,
dest //
);
}
//
iBox.Clean();
iZone.Clean();
}
//
result = ArraySize(dest);
//
return result;
}
//
//
//
/**
* Get Oldest Index ...
*
* @param source: XOBFVG instance Reference Collection ...
*
* @return ( int )
*/
int GetOldest(
XOBFVG &source[] //
)
{
//
int result = -1;
//
int count = ArraySize(source);
if (!IsValidSize(count))
{
return result;
}
//
XBoxZone tmpBoxes[];
int boxesCount = ToBox(
source,
tmpBoxes //
);
if (!IsValidSize(boxesCount))
{
//
Clean(tmpBoxes);
return result;
}
//
XBoxZone selected;
for (int i = 0; i < boxesCount; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
//
bool canSet =
!selected.IsValid()
? true
: selected.from > iBox.from;
if (canSet)
{
//
result = i;
selected = iBox;
}
}
//
Clean(tmpBoxes);
selected.Clean();
//
return result;
}
/**
* Get Youngest Index ...
*
* @param source: XOBFVG instance Reference Collection ...
*
* @return ( int )
*/
int GetYoungest(
XOBFVG &source[] //
)
{
//
int result = -1;
//
int count = ArraySize(source);
if (!IsValidSize(count))
{
return result;
}
//
XBoxZone tmpBoxes[];
int boxesCount = ToBox(
source,
tmpBoxes //
);
if (!IsValidSize(boxesCount))
{
//
Clean(tmpBoxes);
return result;
}
//
XBoxZone selected;
for (int i = 0; i < boxesCount; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
//
bool canSet =
!selected.IsValid()
? true
: selected.from < iBox.from;
if (canSet)
{
//
result = i;
selected = iBox;
}
}
//
Clean(tmpBoxes);
selected.Clean();
//
return result;
}
/**
* Get Highest Index ...
*
* @param source: XOBFVG instance Reference Collection ...
*
* @return ( int )
*/
int GetHighest(
XOBFVG &source[] //
)
{
//
int result = -1;
//
int count = ArraySize(source);
if (!IsValidSize(count))
{
return result;
}
//
XBoxZone tmpBoxes[];
int boxesCount = ToBox(
source,
tmpBoxes //
);
if (!IsValidSize(boxesCount))
{
//
Clean(tmpBoxes);
return result;
}
//
XBoxZone selected;
for (int i = 0; i < boxesCount; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
//
bool canSet =
!selected.IsValid()
? true
: selected.upper < iBox.upper;
if (canSet)
{
//
result = i;
selected = iBox;
}
}
//
Clean(tmpBoxes);
selected.Clean();
//
return result;
}
/**
* Get Lowest Index ...
*
* @param source: XOBFVG instance Reference Collection ...
*
* @return ( int )
*/
int GetLowest(
XOBFVG &source[] //
)
{
//
int result = -1;
//
int count = ArraySize(source);
if (!IsValidSize(count))
{
return result;
}
//
XBoxZone tmpBoxes[];
int boxesCount = ToBox(
source,
tmpBoxes //
);
if (!IsValidSize(boxesCount))
{
//
Clean(tmpBoxes);
return result;
}
//
XBoxZone selected;
for (int i = 0; i < boxesCount; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
//
bool canSet =
!selected.IsValid()
? true
: selected.lower > iBox.lower;
if (canSet)
{
//
result = i;
selected = iBox;
}
}
//
Clean(tmpBoxes);
selected.Clean();
//
return result;
}
//