passing refeerence of class
hi ,
i have a class by the name Node which is linked to class Interest ,Data,Timer.
Node _____*Interest______0..1 Data_______Timer
in timer class i start a thread ,after thread expires ,i want to set a flag in node class...how can i pass the reference for the specific node object to the timer class so that it sets the flag of specific node.
should i pass the reference in the constructors of Interest,Data classes ,what would be the referenc for that
Re: passing refeerence of class
What did you try? It seems from your description you have a few ideas eg pass the reference to the constructor and hold onto said reference in a variable.
Re: passing refeerence of class
You must pass the reference to Node through the main class that runs your program. Interest must accept Node as a parameter and give it to Data, which then feeds it to Timer.