// FIXME
Table tbl = *class_data(table);
Field idField = tbl.FindField(defaultIdField);
- Row r { tbl };
+ Row r;
+ idRowCacheMutex.Wait();
+ if(!tbl.cachedIdRow)
+ {
+ tbl.cachedIdRow = Row { tbl };
+ incref tbl.cachedIdRow;
+ }
+ r = tbl.cachedIdRow;
if(this)
{
PrintLn("Id::OnGetString -- data type"/*, this._class.name, */" has no class_data(nameField)");
}
}
+ else
+ sprintf(tempString, "(Invalid %s entry: %d)", tbl.name, this);
}
else
{
sprintf(tempString, $"(Click to add a new %s...)", $"item"/*class_data(addText)*/);
}
- delete r;
+ // delete r;
+ idRowCacheMutex.Release();
}
return tempString;
}
channel.Serialize(none);
}
}
-
+ /*
void OnDisplay(Surface surface, int x, int y, int width, void * fieldData, Alignment alignment, DataDisplayFlags displayFlags)
{
}
+ */
char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
{
int OnCompare(IdList b)
{
- if(count > b.count) return 1;
+ if(!this && !b) return 0;
+ else if(this && !b) return 1;
+ else if(!this && b) return -1;
+ else if(count > b.count) return 1;
else if(count < b.count) return -1;
else
{
bool Add(String string)
{
- BTNode node { key = (uint)CopyString(string) };
+ BTNode node { key = (uintptr)CopyString(string) };
if(strings.Add(node))
return true;
else