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:
parent
6815f87256
commit
190ead625f
27
cwFlow.cpp
27
cwFlow.cpp
@ -873,8 +873,12 @@ namespace cw
|
|||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
|
|
||||||
for(instance_t* inst = p->network_head; inst!=nullptr; inst=inst->link)
|
for(instance_t* inst = p->network_head; inst!=nullptr; inst=inst->link)
|
||||||
|
{
|
||||||
if((rc = inst->class_desc->members->exec(inst)) != kOkRC )
|
if((rc = inst->class_desc->members->exec(inst)) != kOkRC )
|
||||||
break;
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return rc;
|
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;
|
rc_t rc = kOkRC;
|
||||||
handle_t flowH;
|
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
|
// create the flow object
|
||||||
if((rc = create( flowH, *class_cfg, *cfg)) != kOkRC )
|
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;
|
goto errLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//print_network(flowH);
|
||||||
|
|
||||||
// run the network
|
// run the network
|
||||||
if((rc = exec( flowH )) != kOkRC )
|
if((rc = exec( flowH )) != kOkRC )
|
||||||
rc = cwLogError(rc,"Execution failed.");
|
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:
|
errLabel:
|
||||||
|
if( class_cfg != nullptr )
|
||||||
|
class_cfg->free();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user