Skip to content
Snippets Groups Projects
Commit 8f324490 authored by Antoine Merle's avatar Antoine Merle Committed by Cristian Galperti
Browse files

First fully working version

parent 7ae0a712
No related branches found
No related tags found
No related merge requests found
......@@ -5,17 +5,30 @@ FUN PUBLIC make_dict(_type, optional _inode, optional _ithread)
_thread = present(_ithread) ? iii(_ithread,2) : "%%";
_node = present(_inode ) ? iii(_inode ,2) : "%%";
_nodestr= ($SHOT>65700) ? "\\top.node" : "\\top.tcvrt";
_nodestr= ($SHOT>65700 || $SHOT==-1) ? "node" : "tcvrt";
_base = _nodestr//_node//".thread"//_thread//"."//_type//"s:"//_type//"_%%%";
_base = "\\rtc::top."//_nodestr//_node//".thread"//_thread//"."//_type//"s:"//_type//"_%%%";
write(*,"[make_dict] base="//_base);
_nids = TreeFindNodeWild(_base);
_path = getnci(_nids,"PATH");
if (size(_path)>0)
{
_len = getnci(_path//":raw","LENGTH");
_path = pack(_path,_len>0);
}
_len = getnci(_base//":raw","LENGTH");
_path = getnci(_base ,"PATH" );
if (size(_path)>0)
{
_name = getnci(_path//":name","record");
_order = sort(_name) : *;
_path = pack(_path,_len>0);
_name = getnci(_path//":name","record");
_order = sort(_name);
return(MAKE_SIGNAL(_path[_order],*,_name[_order]));
_dict = MAKE_SIGNAL(_path[_order],*,_name[_order]);
}
else
{
_dict = MAKE_SIGNAL([],*,[]);
}
return(_dict);
}
FUN PUBLIC rtc_get(_type, _name, optional _inode, optional _ithread, optional _dict)
{
if (!present(_dict))
_has_inode = present(_inode ) && KIND(_inode )>0;
_has_ithread = present(_ithread) && KIND(_ithread)>0;
_has_dict = present(_dict ) && KIND(_dict )>0;
if (!_has_dict)
{
_thread = present(_ithread) ? iii(_ithread,2) : "%%";
_node = present(_inode ) ? iii(_inode ,2) : "%%";
_nodestr= ($SHOT>65700 || $SHOT==-1) ? "node" : "tcvrt";
_thread = _has_ithread ? ".thread"//iii(_ithread,2) : "";
_node = _has_inode ? _nodestr //iii(_inode ,2) : "";
_nodestr= ($SHOT>65700) ? "\\top.node" : "\\top.tcvrt";
_base = _nodestr//_node//".thread"//_thread//":dict_"//_type//"s";
_base = "\\rtc::top."//_node//_thread//":dict_"//_type//"s";
/*write(*,"[rtc_get] type="//_type//" base="//_base);*/
_dict = build_path(_base);
}
_mem = _dict[_name];
_mem = size(_dict)>0 ? _dict[_name] : abort();
if (dim_of(_mem) != _name) { abort();}
return(BUILD_PATH(data(_mem)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment