cwFlow.h/cpp : Argument object to test() now contains the name of the flow_proc_dict file rather than receiving it as a separate arg..

This commit is contained in:
kevin 2023-03-17 18:24:07 -04:00
parent 6815f87256
commit 190ead625f
2 changed files with 29 additions and 6 deletions

View File

@ -873,8 +873,12 @@ namespace cw
rc_t rc = kOkRC;
for(instance_t* inst = p->network_head; inst!=nullptr; inst=inst->link)
{
if((rc = inst->class_desc->members->exec(inst)) != kOkRC )
break;
{
break;
}
}
return rc;
}
@ -1210,11 +1214,26 @@ void cw::flow::print_network( handle_t h )
}
cw::rc_t cw::flow::test( const object_t* class_cfg, const object_t* cfg )
cw::rc_t cw::flow::test( const object_t* cfg )
{
rc_t rc = kOkRC;
handle_t flowH;
object_t* class_cfg = nullptr;
const char* flow_proc_fname;
if((rc = cfg->getv("flow_proc_fname",flow_proc_fname)) != kOkRC )
{
rc = cwLogError(rc,"The name of the flow_proc_dict file could not be parsed.");
goto errLabel;
}
if((rc = objectFromFile(flow_proc_fname,class_cfg)) != kOkRC )
{
rc = cwLogError(rc,"The flow proc dict could not be read from '%s'.",cwStringNullGuard(flow_proc_fname));
goto errLabel;
}
// create the flow object
if((rc = create( flowH, *class_cfg, *cfg)) != kOkRC )
{
@ -1222,6 +1241,8 @@ cw::rc_t cw::flow::test( const object_t* class_cfg, const object_t* cfg )
goto errLabel;
}
//print_network(flowH);
// run the network
if((rc = exec( flowH )) != kOkRC )
rc = cwLogError(rc,"Execution failed.");
@ -1235,6 +1256,8 @@ cw::rc_t cw::flow::test( const object_t* class_cfg, const object_t* cfg )
}
errLabel:
if( class_cfg != nullptr )
class_cfg->free();
return rc;
}

View File

@ -82,7 +82,7 @@ namespace cw
void print_class_list( handle_t h );
void print_network( handle_t h );
rc_t test( const object_t* class_cfg, const object_t* cfg );
rc_t test( const object_t* cfg );