src/core/attribute-list.h
changeset 2965 4b28e9740e3b
parent 2834 1aab57845b07
child 3182 61fe7fe81ebd
equal deleted inserted replaced
2964:4e8cb1577144 2965:4b28e9740e3b
    46    * This method checks that a attribute with the requested
    46    * This method checks that a attribute with the requested
    47    * name exists and that the value specified is an acceptable
    47    * name exists and that the value specified is an acceptable
    48    * value of that attribute. If any of these checks fails,
    48    * value of that attribute. If any of these checks fails,
    49    * the program terminates with a message.
    49    * the program terminates with a message.
    50    */
    50    */
    51   void Set (std::string name, Attribute value);
    51   void Set (std::string name, const AttributeValue &value);
    52   /**
    52   /**
    53    * \param name the full name of the attribute to set
    53    * \param name the full name of the attribute to set
    54    * \param value the value to set
    54    * \param value the value to set
    55    * \returns true if the requested attribute exists and could be
    55    * \returns true if the requested attribute exists and could be
    56    *          stored, false otherwise.
    56    *          stored, false otherwise.
    57    */
    57    */
    58   bool SetFailSafe (std::string name, Attribute value);
    58   bool SetFailSafe (std::string name, const AttributeValue &value);
    59   /**
    59   /**
    60    * \param tid the TypeId associated to this attribute
    60    * \param tid the TypeId associated to this attribute
    61    * \param name the name (not full!) of the attribute
    61    * \param name the name (not full!) of the attribute
    62    * \param value the value to set
    62    * \param value the value to set
    63    *
    63    *
    64    * This method checks that a attribute with the requested
    64    * This method checks that a attribute with the requested
    65    * name exists and that the value specified is an acceptable
    65    * name exists and that the value specified is an acceptable
    66    * value of that attribute. If any of these checks fails,
    66    * value of that attribute. If any of these checks fails,
    67    * the program terminates with a message.
    67    * the program terminates with a message.
    68    */
    68    */
    69   void SetWithTid (TypeId tid, std::string name, Attribute value);
    69   void SetWithTid (TypeId tid, std::string name, const AttributeValue &value);
    70 
    70 
    71   /**
    71   /**
    72    * Clear the content of this instance.
    72    * Clear the content of this instance.
    73    */
    73    */
    74   void Reset (void);
    74   void Reset (void);
    90   bool DeserializeFromString (std::string value);
    90   bool DeserializeFromString (std::string value);
    91 private:
    91 private:
    92   friend class ObjectBase;
    92   friend class ObjectBase;
    93   struct Attr {
    93   struct Attr {
    94     Ptr<const AttributeChecker> checker;
    94     Ptr<const AttributeChecker> checker;
    95     Attribute value;
    95     Ptr<const AttributeValue> value;
    96   };
    96   };
    97   typedef std::vector<struct Attr> Attrs;
    97   typedef std::vector<struct Attr> Attrs;
    98   typedef Attrs::iterator Iterator;
    98   typedef Attrs::iterator Iterator;
    99   typedef Attrs::const_iterator CIterator;
    99   typedef Attrs::const_iterator CIterator;
   100 
   100 
   101 
   101 
   102 
   102 
   103   bool DoSet (struct TypeId::AttributeInfo *info, Attribute param);
   103   bool DoSet (struct TypeId::AttributeInfo *info, const AttributeValue &param);
   104   void DoSetOne (Ptr<const AttributeChecker> checker, Attribute param);
   104   void DoSetOne (Ptr<const AttributeChecker> checker, const AttributeValue &param);
   105   std::string LookupAttributeFullNameByChecker (Ptr<const AttributeChecker> checker) const;
   105   std::string LookupAttributeFullNameByChecker (Ptr<const AttributeChecker> checker) const;
   106 
   106 
   107   Attrs m_attributes;
   107   Attrs m_attributes;
   108 };
   108 };
   109 
   109