Sanjay Meher
New member
hi
I am going through the utility functions available and have come across the following difficulty in UtliVisit.c
I can't understand the difference between the following two functions
/*========================================================== ==========*\
FUNCTION roUtilAsmTraverse()
PURPOSE :Visit function for components of an assembly at ALL levels
\*========================================================== ==========*/
ProError ProUtilAsmTraverse(
ProAssembly assembly,
ProFunction action,
ProAppData app_data)
{
ProError status;
AsmTrav_data_t asm_data;
ProIdTable comp_id_table;
/*---------------------------------------------------------- ----------*\
Initialize our asm_data
\*---------------------------------------------------------- ----------*/
asm_data.app_data = app_data;
asm_data.action = (ProTestAsmTravAction)action;
comp_id_table[0] = -1;
status = ProAsmcomppathInit(assembly, comp_id_table, 0,
&asm_data.comp_path);
TEST_CALL_REPORT("ProAsmcomppathInit()", "ProUtilAsmTraverse()",
status, status != PRO_TK_NO_ERROR);
/*---------------------------------------------------------- ----------*\
Visit the components are this level
\*---------------------------------------------------------- ----------*/
ProUtilAsmcompVisit(assembly, (ProFunction)ProUtilAsmTravAction,
(ProAppData)&asm_dat a);
return(PRO_TK_NO_ERROR);
}
/*========================================================== ==========*\
FUNCTION : ProUtilAsmFeatsTraverse()
PURPOSE : Visit function for features of an assembly at *ALL* levels
\*========================================================== ==========*/
ProError ProUtilAsmFeatsTraverse(
ProAssembly assembly,
ProFunction action,
ProAppData app_data)
{
ProError status;
AsmTrav_data_t asm_data;
ProIdTable comp_id_table;
/*---------------------------------------------------------- ----------*\
Initialize our asm_data
\*---------------------------------------------------------- ----------*/
asm_data.app_data = app_data;
asm_data.action = (ProTestAsmTravAction) action;
comp_id_table[0] = -1;
status = ProAsmcomppathInit(assembly, comp_id_table, 0,
&asm_data.comp_path);
TEST_CALL_REPORT("ProAsmcomppathInit()", "ProUtilAsmTraverse()",
status, status != PRO_TK_NO_ERROR);
/*---------------------------------------------------------- ----------*\
Visit the components are this level
\*---------------------------------------------------------- ----------*/
ProUtilAsmcompVisit(assembly, (ProFunction) ProUtilAsmTravAction,
(ProAppData)&asm_data);
return(PRO_TK_NO_ERROR);
}
Though in the comments they have mentioned their usage. However the code of both the function are exactly the same. Can any one tell me where tje dofference is in both the function.
If not then what is missing that has to be corrected in either of the function.
Thanks
Sanjay Meher
I am going through the utility functions available and have come across the following difficulty in UtliVisit.c
I can't understand the difference between the following two functions
/*========================================================== ==========*\
FUNCTION roUtilAsmTraverse()
PURPOSE :Visit function for components of an assembly at ALL levels
\*========================================================== ==========*/
ProError ProUtilAsmTraverse(
ProAssembly assembly,
ProFunction action,
ProAppData app_data)
{
ProError status;
AsmTrav_data_t asm_data;
ProIdTable comp_id_table;
/*---------------------------------------------------------- ----------*\
Initialize our asm_data
\*---------------------------------------------------------- ----------*/
asm_data.app_data = app_data;
asm_data.action = (ProTestAsmTravAction)action;
comp_id_table[0] = -1;
status = ProAsmcomppathInit(assembly, comp_id_table, 0,
&asm_data.comp_path);
TEST_CALL_REPORT("ProAsmcomppathInit()", "ProUtilAsmTraverse()",
status, status != PRO_TK_NO_ERROR);
/*---------------------------------------------------------- ----------*\
Visit the components are this level
\*---------------------------------------------------------- ----------*/
ProUtilAsmcompVisit(assembly, (ProFunction)ProUtilAsmTravAction,
(ProAppData)&asm_dat a);
return(PRO_TK_NO_ERROR);
}
/*========================================================== ==========*\
FUNCTION : ProUtilAsmFeatsTraverse()
PURPOSE : Visit function for features of an assembly at *ALL* levels
\*========================================================== ==========*/
ProError ProUtilAsmFeatsTraverse(
ProAssembly assembly,
ProFunction action,
ProAppData app_data)
{
ProError status;
AsmTrav_data_t asm_data;
ProIdTable comp_id_table;
/*---------------------------------------------------------- ----------*\
Initialize our asm_data
\*---------------------------------------------------------- ----------*/
asm_data.app_data = app_data;
asm_data.action = (ProTestAsmTravAction) action;
comp_id_table[0] = -1;
status = ProAsmcomppathInit(assembly, comp_id_table, 0,
&asm_data.comp_path);
TEST_CALL_REPORT("ProAsmcomppathInit()", "ProUtilAsmTraverse()",
status, status != PRO_TK_NO_ERROR);
/*---------------------------------------------------------- ----------*\
Visit the components are this level
\*---------------------------------------------------------- ----------*/
ProUtilAsmcompVisit(assembly, (ProFunction) ProUtilAsmTravAction,
(ProAppData)&asm_data);
return(PRO_TK_NO_ERROR);
}
Though in the comments they have mentioned their usage. However the code of both the function are exactly the same. Can any one tell me where tje dofference is in both the function.
If not then what is missing that has to be corrected in either of the function.
Thanks
Sanjay Meher