[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] How to find out the destination node's address from C++ Queue class



I have written a new Queue class similar to DropTail.
In the new class, I want to access the destination node
of the link which uses this new queue type. How can I know
the node's address?

I have tried to find out the node's address using target_
of Queue class as follows:

    Node * node = dynamic_cast< Node * > (target_) ;
    int addr = node->address();
    printf("Address = %d\n", addr);

However, it doesn't work. Is Queue class's target_
pointing to a node? Can I dynamically find out what class
a target_ is pointing to in my program?

Thank you.