src/core/type-id-default-value.h
changeset 2577 5b41cb5c3fcf
parent 2576 793375cbbed6
child 2578 685b62ddfbd8
equal deleted inserted replaced
2576:793375cbbed6 2577:5b41cb5c3fcf
     1 #ifndef INTERFACE_ID_DEFAULT_VALUE_H
       
     2 #define INTERFACE_ID_DEFAULT_VALUE_H
       
     3 
       
     4 #include "default-value.h"
       
     5 #include "object.h"
       
     6 
       
     7 namespace ns3 {
       
     8 
       
     9 class TypeIdDefaultValue : public DefaultValueBase
       
    10 {
       
    11 public:
       
    12   /**
       
    13    * \param name the name of this default value.
       
    14    * \param help the help text associated to this default value
       
    15    * \param tid the interface id which all objects created
       
    16    *        through this "default value" must support.
       
    17    * \param defaultValue the name of the object to create
       
    18    *        by default.
       
    19    */
       
    20   TypeIdDefaultValue (std::string name, 
       
    21 			   std::string help,
       
    22 			   TypeId tid,
       
    23 			   std::string defaultValue);
       
    24   /**
       
    25    * \returns the TypeId of the object selected by the user.
       
    26    */
       
    27   TypeId GetValue (void) const;
       
    28   /**
       
    29    * \param interfaceId the new ClassId selected.
       
    30    *
       
    31    * Override the currently-selected value.
       
    32    */
       
    33   void SetValue (TypeId interfaceId);
       
    34   /**
       
    35    * \param name the new object selected.
       
    36    *
       
    37    * Override the currently-selected value.
       
    38    */
       
    39   void SetValue (std::string name);
       
    40 private:
       
    41   virtual bool DoParseValue (const std::string &value);
       
    42   virtual std::string DoGetType (void) const;
       
    43   virtual std::string DoGetDefaultValue (void) const;
       
    44   std::string m_defaultName;
       
    45   std::string m_name;
       
    46   TypeId m_interfaceId;
       
    47 };
       
    48 
       
    49 } // namespace ns3
       
    50 
       
    51 #endif /* INTERFACE_ID_DEFAULT_VALUE_H */