Studio:Working with "default" candidates: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
scl_ptr_flist() serves as a "shorthand" method of declaring a "default" candidate.<br> | scl_ptr_flist() serves as a "shorthand" method of declaring a "default" candidate.<br><br> | ||
'''Note''': When using scl_ptr_flist() to define candidates, the function pointer prototypes are defined internally within STRIDE, rather than by the user. <br> | '''Note''': When using scl_ptr_flist() to define candidates, the function pointer prototypes are defined internally within STRIDE, rather than by the user. <br> | ||
'''Example'''<br> | '''Example'''<br> | ||
<tt>// function pointer typedef | <tt>// function pointer typedef<br> | ||
typedef void (*FPtr) (int, char);<br> | |||
typedef void (*FPtr) (int, char); | void foo(FPtr *pFPtr);<br> | ||
void foo(FPtr *pFPtr); | void foo1(FPtr *pFPtr);<br> | ||
void foo1(FPtr *pFPtr); | void foo2(FPtr *pFPtr);<br> | ||
void foo2(FPtr *pFPtr); | void foo3(FPtr *pFPtr);<br><br> | ||
void foo3(FPtr *pFPtr); | // candidate prototypes <br> | ||
void C1(int x, char y);<br> | |||
// candidate prototypes | void C2(int x, char y);<br> | ||
void C3(int x, char y);<br><br> | |||
void C1(int x, char y); | // pragmatize candidate prototypes<br> | ||
void C2(int x, char y); | #pragma scl_function(C1)<br> | ||
void C3(int x, char y); | #pragma scl_function(C2)<br> | ||
#pragma scl_function(C3)<br> | |||
// pragmatize candidate prototypes | |||
#pragma scl_function(C1) | |||
#pragma scl_function(C2) | |||
#pragma scl_function(C3) |
Revision as of 21:01, 12 June 2007
scl_ptr_flist() serves as a "shorthand" method of declaring a "default" candidate.
Note: When using scl_ptr_flist() to define candidates, the function pointer prototypes are defined internally within STRIDE, rather than by the user.
Example
// function pointer typedef
typedef void (*FPtr) (int, char);
void foo(FPtr *pFPtr);
void foo1(FPtr *pFPtr);
void foo2(FPtr *pFPtr);
void foo3(FPtr *pFPtr);
// candidate prototypes
void C1(int x, char y);
void C2(int x, char y);
void C3(int x, char y);
// pragmatize candidate prototypes
#pragma scl_function(C1)
#pragma scl_function(C2)
#pragma scl_function(C3)