WIP: use pt::Stream instead of a template argument

This commit is contained in:
2024-12-05 17:48:06 +01:00
parent d9ffe9b00a
commit e39311c290
12 changed files with 777 additions and 707 deletions

View File

@@ -58,6 +58,32 @@ void Cache(Blocks & blocks, Item::Function & function)
}
void Cache(Functions & fun, Item::Function & function)
{
function.fun_cache = 0;
if( !function.name.empty() && function.arg < 0 )
{
typename Functions::Iterator i = fun.Find(function.name);
if( i != fun.End() )
function.fun_cache = &i->second;
}
for(size_t i=0 ; i < function.parameters.size() ; ++i)
Cache(fun, *function.parameters[i]);
}
void Cache(Functions & fun, Item & item)
{
Cache(fun, item.function);
for(size_t i=0; i < item.item_tab.size() ; ++i)
Cache(fun, *item.item_tab[i]);
}
void Cache(Blocks & blocks, Item & item)
{
@@ -68,6 +94,31 @@ void Cache(Blocks & blocks, Item & item)
}
void Cache(Objects & objects, Item::Function & function)
{
function.base_obj = 0;
function.method_index = -1;
if( !function.name.empty() && function.arg < 0 )
{
typename Objects::Iterator i = objects.Find(function.name, function.method_index);
if( i != objects.End() )
function.base_obj = *i;
}
for(size_t i=0 ; i < function.parameters.size() ; ++i)
Cache(objects, *function.parameters[i]);
}
void Cache(Objects & objects, Item & item)
{
Cache(objects, item.function);
for(size_t i=0; i < item.item_tab.size() ; ++i)
Cache(objects, *item.item_tab[i]);
}