src/core/model/attribute.h
author Peter D. Barnes, Jr. <barnes26@llnl.gov>
Wed, 07 Jan 2015 15:43:53 -0800
changeset 11136 03bf8fa63bda
parent 11035 4c13b42eabcd
child 11538 397bd6465dd9
permissions -rw-r--r--
[Doxygen] Files implementing attributes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2581
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     2
/*
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     3
 * Copyright (c) 2008 INRIA
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     4
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     7
 * published by the Free Software Foundation;
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     8
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    12
 * GNU General Public License for more details.
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    13
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    14
 * You should have received a copy of the GNU General Public License
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    15
 * along with this program; if not, write to the Free Software
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    17
 *
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    18
 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
31d4960dc31b add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2550
diff changeset
    19
 */
2438
e2ac9f9aeeb9 value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2437
diff changeset
    20
#ifndef ATTRIBUTE_H
e2ac9f9aeeb9 value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2437
diff changeset
    21
#define ATTRIBUTE_H
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include <string>
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include <stdint.h>
2374
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
    25
#include "ptr.h"
5505
c0ac392289c3 replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3997
diff changeset
    26
#include "simple-ref-count.h"
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
11136
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    28
/**
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    29
 * \file
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    30
 * \ingroup attribute
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    31
 * ns3::AttributeValue, ns3::AttributeAccessor and
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    32
 * ns3::AttributeChecker declarations.
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    33
 */
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
    34
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
namespace ns3 {
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
2436
23415bac7eaf Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2435
diff changeset
    37
class AttributeAccessor;
2427
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
    38
class AttributeChecker;
2433
3a98e1db7f80 PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2427
diff changeset
    39
class Attribute;
2633
a0639de8cd8b split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2619
diff changeset
    40
class ObjectBase;
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    42
/**
3182
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    43
 *
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    44
 * \ingroup core
9969
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
    45
 * \defgroup attribute Attributes
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
    46
 *
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
    47
 * The \c ns-3 attribute system is the mechanism used in \c ns-3 to
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
    48
 * organize, document, and modify the *values* used by the various
11035
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    49
 * component models.
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    50
 *
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    51
 * Attributes also enable the tracing and statistics gathering
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    52
 * in the simulator.
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    53
 *
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    54
 * See \ref attributehelper for macros to ease the declaration
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
    55
 * and definition of Attributes.
3182
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    56
 */
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    57
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    58
/**
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    59
 *
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    60
 * \ingroup attribute
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
    61
 *
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    62
 * \brief Hold a value for an Attribute.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    63
 *
2947
b0fec3381418 get rid of scary implementation details of Attribute.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2927
diff changeset
    64
 * Instances of this class should always be wrapped into an Attribute object.
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    65
 * Most subclasses of this base class are implemented by the 
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    66
 * ATTRIBUTE_HELPER_* macros.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    67
 */
5505
c0ac392289c3 replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3997
diff changeset
    68
class AttributeValue : public SimpleRefCount<AttributeValue>
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    69
{
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    70
public:
2437
44e34ffee8e3 Value -> AttributeValue
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2436
diff changeset
    71
  AttributeValue ();
44e34ffee8e3 Value -> AttributeValue
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2436
diff changeset
    72
  virtual ~AttributeValue ();
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    73
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    74
  /**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    75
   * \returns a deep copy of this class, wrapped into an Attribute object.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    76
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
    77
  virtual Ptr<AttributeValue> Copy (void) const = 0;
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    78
  /**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    79
   * \param checker the checker associated to the attribute
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    80
   * \returns a string representation of this value.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    81
   *
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    82
   * In most cases, this method will not make any use of the checker argument.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    83
   * However, in a very limited set of cases, the checker argument is needed to
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    84
   * perform proper serialization. A nice example of code which needs it is
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    85
   * the EnumValue::SerializeToString code.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    86
   */
2427
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
    87
  virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const = 0;
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    88
  /**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    89
   * \param value a string representation of the value
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    90
   * \param checker a pointer to the checker associated to the attribute.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    91
   * \returns true if the input string was correctly-formatted and could be
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    92
   *          successfully deserialized, false otherwise.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    93
   *
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    94
   * Upon return of this function, this AttributeValue instance contains
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    95
   * the deserialized value.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    96
   * In most cases, this method will not make any use of the checker argument.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    97
   * However, in a very limited set of cases, the checker argument is needed to
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    98
   * perform proper serialization. A nice example of code which needs it is
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
    99
   * the EnumValue::SerializeToString code.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   100
   */
2427
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   101
  virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) = 0;
2374
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   102
};
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   103
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   104
/**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   105
 * \brief allow setting and getting the value of an attribute.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   106
 *
3182
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
   107
 * \ingroup attribute
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
   108
 *
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   109
 * The goal of this class is to hide from the user how an attribute
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   110
 * is actually set or get to or from a class instance. Implementations
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   111
 * of this base class are usually provided through the MakeAccessorHelper
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   112
 * template functions, hidden behind an ATTRIBUTE_HELPER_* macro.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   113
 */
5505
c0ac392289c3 replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3997
diff changeset
   114
class AttributeAccessor : public SimpleRefCount<AttributeAccessor>
2374
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   115
{
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   116
public:
2436
23415bac7eaf Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2435
diff changeset
   117
  AttributeAccessor ();
23415bac7eaf Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2435
diff changeset
   118
  virtual ~AttributeAccessor ();
2374
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   119
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   120
  /**
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   121
   * \param object the object instance to set the value in
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   122
   * \param value the value to set
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   123
   * \returns true if the value could be set successfully, false otherwise.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   124
   *
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   125
   * This method expects that the caller has checked that the input value is
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   126
   * valid with AttributeChecker::Check.
2374
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   127
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   128
  virtual bool Set (ObjectBase * object, const AttributeValue &value) const = 0;
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   129
  /**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   130
   * \param object the object instance to get the value from
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   131
   * \param attribute a pointer to where the value should be set.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   132
   * \returns true if the value could be read successfully, and
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   133
   *          stored in the input value, false otherwise.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   134
   *
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   135
   * This method expects that the caller has checked that the input value is
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   136
   * valid with AttributeChecker::Check.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   137
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   138
  virtual bool Get (const ObjectBase * object, AttributeValue &attribute) const = 0;
2950
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   139
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   140
  /**
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   141
   * \return true if this accessor supports the Get operation, false
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   142
   *         otherwise.
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   143
   */
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   144
  virtual bool HasGetter (void) const = 0;
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   145
  /**
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   146
   * \return true if this accessor supports the Set operation, false
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   147
   *         otherwise.
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   148
   */
9e20fb862cd8 add AttributeAccessor::HasGetter/HasSetter and implement it.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2948
diff changeset
   149
  virtual bool HasSetter (void) const = 0;
2427
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   150
};
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   151
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   152
/**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   153
 * \brief Represent the type of an attribute
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   154
 *
3182
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
   155
 * \ingroup attribute
61fe7fe81ebd Doxygen organization
Tom Henderson <tomh@tomh.org>
parents: 2969
diff changeset
   156
 *
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   157
 * Each type of attribute has an associated unique AttributeChecker
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   158
 * subclass. The type of the subclass can be safely used by users
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   159
 * to infer the type of the associated attribute. i.e., we expect
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   160
 * binding authors to use the checker associated to an attribute
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   161
 * to detect the type of the associated attribute.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   162
 *
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   163
 * Most subclasses of this base class are implemented by the 
3997
a66553c56a8f make a pass through doxygen fixing errors
Craig Dowell <craigdo@ee.washington.edu>
parents: 3190
diff changeset
   164
 * ATTRIBUTE_HELPER_HEADER and ATTRIBUTE_HELPER_CPP macros.
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   165
 */
5505
c0ac392289c3 replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3997
diff changeset
   166
class AttributeChecker : public SimpleRefCount<AttributeChecker>
2427
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   167
{
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   168
public:
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   169
  AttributeChecker ();
9245ec163111 split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2424
diff changeset
   170
  virtual ~AttributeChecker ();
7399
520706f801e8 introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 6821
diff changeset
   171
9969
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   172
  /**
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   173
   * Create a valid value from the argument value,
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   174
   * or reinterpret the argument as a string.
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   175
   *
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   176
   * \param value the AttributeValue to check
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   177
   * \return Ptr to a valid value
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   178
   */
7399
520706f801e8 introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 6821
diff changeset
   179
  Ptr<AttributeValue> CreateValidValue (const AttributeValue &value) const;
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   180
  /**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   181
   * \param value a pointer to the value to check
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   182
   * \returns true if the input value is both of the right type
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   183
   *          and if its value is within the requested range. Returns
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   184
   *          false otherwise.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   185
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   186
  virtual bool Check (const AttributeValue &value) const = 0;
2969
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   187
  /**
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   188
   * \returns the c++ fully-qualified typename of the subclass
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   189
   *          of the ns3::AttributeValue base class which is associated
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   190
   *          to this checker.
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   191
   *
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   192
   * A typical return value here is FooValue where Foo is the name of the
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   193
   * type being wrapped.
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   194
   */
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   195
  virtual std::string GetValueTypeName (void) const = 0;
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   196
  /**
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   197
   * \returns true if this checker has information about the underlying
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   198
   *          C++ type, false otherwise.
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   199
   *
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   200
   * If this method returns false, the return value of the GetUnderlyingTypeInformation
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   201
   * method cannot be relied upon.
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   202
   */
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   203
  virtual bool HasUnderlyingTypeInformation (void) const = 0;
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   204
  /**
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   205
   * \returns a human-readable representation of information about
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   206
   *          the underlying C++ type.
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   207
   */
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   208
  virtual std::string GetUnderlyingTypeInformation (void) const = 0;
2583
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   209
  /**
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   210
   * \returns a new instance of an AttributeValue (wrapper in an Attribute 
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   211
   *          instance) which matches the type of the underlying attribute.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   212
   *
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   213
   * This method is typically used to create a temporary variable prior
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   214
   * to calling Attribute::DeserializeFromString.
c09faa6c90bf doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2581
diff changeset
   215
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   216
  virtual Ptr<AttributeValue> Create (void) const = 0;
9969
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   217
  /**
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   218
   * Copy the source to the destination
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   219
9969
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   220
   * \param source source AttributeValue
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   221
   * \param destination destination AttributeValue
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   222
   * \return true if copy was successful
e813ecb3613d [Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7399
diff changeset
   223
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   224
  virtual bool Copy (const AttributeValue &source, AttributeValue &destination) const = 0;
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   225
7399
520706f801e8 introduce Config::Reset
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 6821
diff changeset
   226
  
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   227
};
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   228
11136
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
   229
/**
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
   230
 * \brief A class for an empty attribute value.
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
   231
 *
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
   232
 * \ingroup attribute
03bf8fa63bda [Doxygen] Files implementing attributes.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 11035
diff changeset
   233
 */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   234
class EmptyAttributeValue : public AttributeValue
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   235
{
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   236
public:
11035
4c13b42eabcd [Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10984
diff changeset
   237
  /** Default constructor. */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   238
  EmptyAttributeValue ();
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   239
private:
10984
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   240
  /**
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   241
   * \returns a deep copy of this class, wrapped into an Attribute object.
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   242
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   243
  virtual Ptr<AttributeValue> Copy (void) const;
10984
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   244
  /**
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   245
   * \param checker the checker associated to the attribute
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   246
   * \returns a string representation of this value.
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   247
   *
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   248
   * In the EmptyAttributeValue case, the string returned will be simply ""
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   249
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   250
  virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const;
10984
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   251
  /**
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   252
   * \param value a string representation of the value
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   253
   * \param checker a pointer to the checker associated to the attribute.
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   254
   * \returns true if the input string was correctly-formatted and could be
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   255
   *          successfully deserialized, false otherwise.
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   256
   *
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   257
   * In the trivial case of EmptyAttributeValue, this should always return true
f20ec8fcc676 add doxygen
Tom Henderson <tomh@tomh.org>
parents: 9969
diff changeset
   258
   */
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2950
diff changeset
   259
  virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker);
2371
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   260
};
2118204a86e6 initial work on Value code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   261
2374
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   262
} // namespace ns3
570f3c6c6142 make Ptr<T> convertible to a Value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2371
diff changeset
   263
2438
e2ac9f9aeeb9 value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2437
diff changeset
   264
#endif /* ATTRIBUTE_H */