HOWTO determine all the available Values

From Nsnam
Jump to: navigation, search

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

HOWTO determine all the available Values

Let us suppose you want to create an attribute for some object. Once you decide the type of the attribute (eg. unsigned integer, Time value, ...), you will need to specify an appropriate constructor and an appropriate checker.

For instance, the following is an excerpt from the PacketSink object:

   .AddAttribute ("Local", "The Address on which to Bind the rx socket.",
                  AddressValue (),
                  MakeAddressAccessor (&VoipPacketSink::m_local),
                  MakeAddressChecker ())

As a consequence you may want to check if the value you have in mind has already been defined. You can retrieve the list of all available values, by just giving the following command (YMMV):

   egrep -A3 -RIe 'AddAttribute' src/ | egrep '.Value \(' | sed 's/\(Value\)\(.*$\)/\1/g' | rev | awk '{print $1}' | rev | sort -u