Hello,
This may have been asked earlier but I cant find it so I am asking again. If it is already asked, please let me know the link
I have two possible extensions A and B (for simplicity only). Both are derived from tlm_extension
I have a module name MOD (for simplicity again). In this I am checking if extension A is attached or not.
I am not checking the extension B in MOD. It is just for tracking purposes.
Extension A may or may not be present.
Therefore, i am making check like this
A *extA;
req->get_extension(ext); // tlm::tlm_generic_payload *req is the declaration
if (extA == nullptr) {
do ActionX
} else {
do ActionY
}
Now what is happening is
while sending a request to MOD, I attach extension B. There is not extension A attached.
Therefore, I think that the check
if (extA == nullptr)
should return true. However, this is not the case. gdb is showing extA is actually B when doing p *extA.
I think this is because both A and B are derived from tlm_extension.
Is there anyway, I can do a correct check so that if extension A is not present, it should extA as nullptr especially when A is not present but B is present.?
Regards
Moreshwar