cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

difference between ProUtilAsmTraverse and ProUtilAsmFeatsTraverse

Highlighted

difference between ProUtilAsmTraverse and ProUtilAsmFeatsTraverse


hi guys,

I am going through the utility functions available in <proe>\protoolkit\protk_appls\pt_examples\pt_utils and have come across the following difficulty in UtilVisit.c

I can't understand the difference between the following two functions

/*=============================================*\
FUNCTION : ProUtilAsmTraverse()
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 disturbing part is that the code of both the function are exactly the same. Can any one tell me where the difference is in both the function.

If not then what is missing that has to be corrected in either of the function.

Thanks
Abhishek


1 REPLY 1
Highlighted

RE: difference between ProUtilAsmTraverse and ProUtilAsmFeatsTraverse

Hi,

Though the function ProUtilAsmFeatsTranverse() is not used in any sample, I think this is a good utility which helps us to visit all the features of all the components in the assembly.

Hence if with some changes can make it function in the required way, then it would prove to be a useful utility.

I tried to make some changes but was confused. So thought of taking help of you people.

Hope someone would make the function work as required

Thanks
Abhishek

Frédéric PRADIER <f.pradier@safirinfo.fr> wrote:
Hi,

You're right, they are equal !!
You can just notice that ProUtilAsmFeatsTraverse() is never call in any sample....

Regards,

Fred


[Frédéric PRADIER] -----Message d'origine-----
De : abhishek jaiswal
Envoyé : samedi 27 novembre 2004 11:08
À : PTC/USER Programming Tools Discussion
Objet : [toolkits] difference between ProUtilAsmTraverse and ProUtilAsmFeatsTraverse




hi guys,

I am going through the utility functions available in <proe>\protoolkit\protk_appls\pt_examples\pt_utils and have come across the following difficulty in UtilVisit.c

I can't understand the difference between the following two functions

/*=============================================*\
FUNCTION : ProUtilAsmTraverse()
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 disturbing part is that the code of both the function are exactly the same. Can any one tell me where the difference is in both the function.

If not then what is missing that has to be corrected in either of the function.

Thanks
Abhishek


Announcements