src/contrib/attribute-default-iterator.h
changeset 6941 9d2c79c992d7
parent 6940 afe2960e58b7
child 6942 3b9ce3a727a5
equal deleted inserted replaced
6940:afe2960e58b7 6941:9d2c79c992d7
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  *  This program is free software; you can redistribute it and/or modify
       
     4  * it under the terms of the GNU General Public License version 2 as
       
     5  * published by the Free Software Foundation;
       
     6  *
       
     7  * This program is distributed in the hope that it will be useful,
       
     8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
     9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    10  * GNU General Public License for more details.
       
    11  *
       
    12  * You should have received a copy of the GNU General Public License
       
    13  * along with this program; if not, write to the Free Software
       
    14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    15  * 
       
    16  * Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
       
    17  *          Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
       
    18  */
       
    19  
       
    20 #ifndef ATTRIBUTE_DEFAULT_ITERATOR_H
       
    21 #define ATTRIBUTE_DEFAULT_ITERATOR_H
       
    22 
       
    23 #include "ns3/type-id.h"
       
    24 #include <string>
       
    25 
       
    26 namespace ns3 {
       
    27 
       
    28 class AttributeDefaultIterator
       
    29 {
       
    30 public:
       
    31   virtual ~AttributeDefaultIterator () = 0;
       
    32   /**
       
    33    * \brief This function will go through all the TypeIds and get only the attributes which are
       
    34    * explicit values (not vectors or pointer or arrays) and apply StartVisitTypeId
       
    35    * and VisitAttribute on the attributes in one TypeId. At the end of each TypeId
       
    36    * EndVisitTypeId is called.
       
    37    */
       
    38   void Iterate (void);
       
    39 private:
       
    40   /**
       
    41    * \brief Just an interface that needs to be implemented
       
    42    */
       
    43   virtual void StartVisitTypeId (std::string name);
       
    44   /**
       
    45    * \brief Just an interface that needs to be implemented
       
    46    */
       
    47   virtual void EndVisitTypeId (void);
       
    48   /**
       
    49    * \brief This method can be implemented, otherwise, it will call DoVisitAttribute
       
    50    */
       
    51   virtual void VisitAttribute (TypeId tid, std::string name, std::string defaultValue, uint32_t index);
       
    52   /**
       
    53    * \brief This method is just an interface and needs to be implemented
       
    54    */
       
    55   virtual void DoVisitAttribute (std::string name, std::string defaultValue);
       
    56 };
       
    57 
       
    58 } // namespace ns3
       
    59 
       
    60 #endif /* ATTRIBUTE_DEFAULT_ITERATOR_H */