Meaning of c++ line in ns2 program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Harish virat
    New Member
    • Sep 2014
    • 1

    #1

    Meaning of c++ line in ns2 program

    can u suggest the meaning of the below line
    RouteCacheTimer (AODV* a) : agent(a) {}
    void handle(Event*);
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    It looks like a constructor for the RouteCacheTimer class. The : is used to define an initialization list for members of an object as part of the building the object.

    Since I don't see the scope resolution operator (::) I assume this code is inside the RouteCacheTimer class which also makes this an inline function.

    Comment

    Working...