Function parameters for member functions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Function parameters for member functions

284件の閲覧回数
Annodizer
Contributor I

Hi, first time posting so apologies if this is a duplicate. I couldn't see anything similar.

Is there a way to display function parameters for struct member functions? Parameters are included in the member function declaration within the struct but when writing function calls to the member function, hitting ctrl-space the suggestions are blank and ctrl-shift-space does not work.

Struct declaration is below.

Many thanks.

MCUXpresso-IDE 

typedef struct _protobufBuffer

{

// Pointer to self

struct _protobufBuffer *self;

 

// Member variables

uint8_t data[BUFFER_SIZE];

uint8_t *dataLocation;

 

// Member functions

void (*resetData)(void);

uint32_t (*getAvailableSpace)(void *pBufferLocation);

 

} protobufBuffer_t;

0 件の賞賛
返信
3 返答(返信)

204件の閲覧回数
Annodizer
Contributor I

Hi Alice, thanks for the reply but that's not what I'm asking. I didn't do a very good job of explaining myself!

What I would like to see is the parameter list for a member function. When I define a function I can hit ctrl+shift+space to bring up the parameters that the function is expecting to receive as in the screenshot below.Screenshot 2024-08-26 at 14.21.10.png

When I use a function pointer within a type to point to this function so i can access it through dot notation I can see the function pointer definition showing me that it returns a uint32_t and accepts a void pointer as in the below image but it doesn't show me the parameter name as declared in the function declaration. 

Screenshot 2024-08-26 at 14.22.01.png

My question is, is there a way to get the same function parameter list as when you call the function directly, when you access it as a member function of a struct? Pressing ctrl+shift+space at the point shown below does not show the functions expected parameters or give any other assistance. Hopefully that makes it a little clearer?

Screenshot 2024-08-26 at 14.22.33.png

Thanks for the assistance!

0 件の賞賛
返信

181件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Annodizer 

Thanks for your detail description. I know your meaning know. While sorry for the  function pointer, can not show the  parameter. Because the pointer just points to the address of function, does not include the parameter information.

 

BR

Alice

0 件の賞賛
返信

249件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Annodizer

I'm not sure understand your meaning. If you want show the member of structure, please use "." or '->' as below, members will be showed automatically.

Alice_Yang_2-1724041332512.pngAlice_Yang_3-1724041338034.png

Please describe more detail is this is not your need. Thanks.

 

BR

Alice

 

 

0 件の賞賛
返信