0

I have a problem to understand the following code. Can anybody please help me to understand it.

indication = MediumIndication::IDLE;
catIndication = bb->subscribe(this, mi, getParentModule()->getId());

catRadioState = bb->subscribe(this, cs, getParentModule()->getId());

catDroppedPacket = bb->getCategory(droppedPacket);

Specially, in this "bb->subscribe(this, mi, getParentModule()->getId());" part.

Here 'MediumIndication', is a Class, 'mi', 'cs' are object of a class, 'subcribe' is a function, 'getParentModule()', 'getId()' are functions. droppedPacket is also an object of a class. 'bb' is a pointer to a class. I hope it is now clear to you.

Thanks in advance.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Ancient Dragon
0

You said it yourself: Here 'MediumIndication', is a Class, 'mi', 'cs' are object of a class, 'subcribe' is a function, 'getParentModule()', 'getId()' are functions. droppedPacket is also an object of a class. 'bb' is a pointer to a class. I hope it is now clear to you.

What more do you expect from us??

0

You said it yourself: Here 'MediumIndication', is a Class, 'mi', 'cs' are object of a class, 'subcribe' is a function, 'getParentModule()', 'getId()' are functions. droppedPacket is also an object of a class. 'bb' is a pointer to a class. I hope it is now clear to you.

What more do you expect from us??

ok, specifically I didn't understand the following line:
bb->subscribe(this, &mi, getParentModule()->getId())

here what 'bb' tries to do with 'subscribe', though they are not defined in the same class.

0

you will have to look at the class declarations to find out how subscribe is declared. If its not in the same class as bb then it must be in one of bb's ancestors.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.