author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Tue, 09 Dec 2014 13:17:49 -0800 | |
changeset 11097 | caafe12b0378 |
parent 11035 | 4c13b42eabcd |
child 11136 | 03bf8fa63bda |
permissions | -rw-r--r-- |
2581
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
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:
2520
diff
changeset
|
2 |
/* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
4 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
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:
2520
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:
2520
diff
changeset
|
7 |
* published by the Free Software Foundation; |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
8 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
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:
2520
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:
2520
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:
2520
diff
changeset
|
12 |
* GNU General Public License for more details. |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
13 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
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:
2520
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:
2520
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:
2520
diff
changeset
|
17 |
* |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
18 |
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
31d4960dc31b
add missing copyright statements.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2520
diff
changeset
|
19 |
*/ |
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
20 |
#ifndef ATTRIBUTE_HELPER_H |
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
21 |
#define ATTRIBUTE_HELPER_H |
2422 | 22 |
|
2502
50d0da37f02f
introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2473
diff
changeset
|
23 |
#include "attribute.h" |
2449
30127bc12056
param-spec-helper.h -> attribute-accessor-helper.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2446
diff
changeset
|
24 |
#include "attribute-accessor-helper.h" |
2446
f2a03c7d069c
fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2443
diff
changeset
|
25 |
#include <sstream> |
f2a03c7d069c
fix includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2443
diff
changeset
|
26 |
#include "fatal-error.h" |
2422 | 27 |
|
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
28 |
namespace ns3 { |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
29 |
|
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
30 |
/** |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
31 |
* \ingroup attribute |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
32 |
* \defgroup attributehelper Attribute Helper |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
33 |
* |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
34 |
* All these macros can be used to generate automatically the code |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
35 |
* for subclasses of AttributeValue, AttributeAccessor, and, AttributeChecker, |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
36 |
* which can be used to give attribute powers to a normal class. i.e., |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
37 |
* the user class can then effectively be made an attribute. |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
38 |
* |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
39 |
* There are two kinds of helper macros: |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
40 |
* -# The simple macros. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
41 |
* - ATTRIBUTE_HELPER_HEADER(type) |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
42 |
* - ATTRIBUTE_HELPER_CPP(type) |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
43 |
* -# The more complex macros. |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
44 |
* |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
45 |
* The simple macros are implemented in terms of the complex |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
46 |
* macros and should generally be preferred over the complex macros. |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
47 |
* |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
48 |
* \note |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
49 |
* Because these macros generate class and function definitions, it's |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
50 |
* difficult to document the results directly. Instead, we use a |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
51 |
* set of functions in print-introspected-doxygen.cc to generate |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
52 |
* most of the APi documentation. When using these macros, |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
53 |
* please add the required function calls to print-introspected-doxygen.cc |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
54 |
* so your new API is documented. |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
55 |
*/ |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
56 |
|
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
57 |
/** |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
58 |
* \ingroup attributehelper |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
59 |
* \defgroup attributeimpl Attribute Implementation |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
60 |
* |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
61 |
* These are the internal implementation functions for the Attribute |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
62 |
* system. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
63 |
* |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
64 |
* Module code shouldn't need to call these directly. Instead, |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
65 |
* see \ref attributehelper. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
66 |
* |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
67 |
* There are three versions of DoMakeAccessorHelperOne: |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
68 |
* - With a member variable: DoMakeAccessorHelperOne(U T::*) |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
69 |
* - With a class get functor: DoMakeAccessorHelperOne(U(T::*)(void) const) |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
70 |
* - With a class set method: DoMakeAccessorHelperOne(void(T::*)(U)) |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
71 |
* |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
72 |
* There are two pairs of DoMakeAccessorHelperTwo (four total): |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
73 |
* - Taking two arguments, a set method and get functor, in either order, |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
74 |
* - With set methods returning \c void or \c bool. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
75 |
*/ |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
76 |
|
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
77 |
/** |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
78 |
* \ingroup attributeimpl |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
79 |
* |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
80 |
* A simple string-based attribute checker |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
81 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
82 |
* \tparam T The specific AttributeValue type used to represent |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
83 |
* the Attribute. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
84 |
* \tparam BASE The AttributeChecker type corresponding to \p T. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
85 |
* \param name The name of the AttributeValue type, essentially the |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
86 |
* string form of \p T. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
87 |
* \param underlying Underlying type name. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
88 |
* \return Ptr to AttributeChecker. |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
89 |
*/ |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
90 |
template <typename T, typename BASE> |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
91 |
Ptr<AttributeChecker> |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
92 |
MakeSimpleAttributeChecker (std::string name, std::string underlying) |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
93 |
{ |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
94 |
/* String-based AttributeChecker implementation. */ |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
95 |
struct SimpleAttributeChecker : public BASE |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
96 |
{ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
97 |
virtual bool Check (const AttributeValue &value) const { |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
98 |
return dynamic_cast<const T *> (&value) != 0; |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
99 |
} |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
100 |
virtual std::string GetValueTypeName (void) const { |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
101 |
return m_type; |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
102 |
} |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
103 |
virtual bool HasUnderlyingTypeInformation (void) const { |
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
104 |
return true; |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
105 |
} |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
106 |
virtual std::string GetUnderlyingTypeInformation (void) const { |
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
107 |
return m_underlying; |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
108 |
} |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
109 |
virtual Ptr<AttributeValue> Create (void) const { |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
110 |
return ns3::Create<T> (); |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
111 |
} |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
112 |
virtual bool Copy (const AttributeValue &source, AttributeValue &destination) const { |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
113 |
const T *src = dynamic_cast<const T *> (&source); |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
114 |
T *dst = dynamic_cast<T *> (&destination); |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
115 |
if (src == 0 || dst == 0) |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
116 |
{ |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
117 |
return false; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
118 |
} |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
119 |
*dst = *src; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
120 |
return true; |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
121 |
} |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
122 |
std::string m_type; // The name of the AttributeValue type. |
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
123 |
std::string m_underlying; // The underlying attribute type name. |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
124 |
} *checker = new SimpleAttributeChecker (); |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
125 |
checker->m_type = name; |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
126 |
checker->m_underlying = underlying; |
2599
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
127 |
return Ptr<AttributeChecker> (checker, false); |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
128 |
} |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
129 |
|
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
130 |
} |
fcc1728eb669
Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2584
diff
changeset
|
131 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
132 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
133 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
134 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
135 |
* Define the attribute accessor functions \c MakeTypeAccessor |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
136 |
* for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
137 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
138 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
139 |
* |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
140 |
* This macro defines and generates the code for the implementation |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
141 |
* of the \c MakeTypeAccessor template functions. This macro is typically |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
142 |
* invoked in a class header to allow users of this class to view and |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
143 |
* use the template functions defined here. This macro is implemented |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
144 |
* through the helper templates functions ns3::MakeAccessorHelper<>. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
145 |
*/ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
146 |
#define ATTRIBUTE_ACCESSOR_DEFINE(type) \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
147 |
template <typename T1> \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
148 |
Ptr<const AttributeAccessor> Make ## type ## Accessor (T1 a1) \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
149 |
{ \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
150 |
return MakeAccessorHelper<type ## Value> (a1); \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
151 |
} \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
152 |
template <typename T1, typename T2> \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
153 |
Ptr<const AttributeAccessor> Make ## type ## Accessor (T1 a1, T2 a2) \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
154 |
{ \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
155 |
return MakeAccessorHelper<type ## Value> (a1, a2); \ |
2422 | 156 |
} |
157 |
||
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
158 |
/** |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
159 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
160 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
161 |
* Declare the attribute value class \p \<name>Value |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
162 |
* for underlying class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
163 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
164 |
* \param type The underlying type name |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
165 |
* \param name The token to use in defining the accessor name. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
166 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
167 |
* This macro declares the class \c TypeValue associated with class \c type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
168 |
* This macro is typically invoked in the class header file. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
169 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
170 |
* This can be used directly for things like plain old data, |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
171 |
* such as \c std::string, to create the attribute value class |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
172 |
* StringValue. |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
173 |
*/ |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
174 |
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type,name) \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
175 |
class name ## Value : public AttributeValue \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
176 |
{ \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
177 |
public: \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
178 |
name ## Value (); \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
179 |
name ## Value (const type &value); \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
180 |
void Set (const type &value); \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
181 |
type Get (void) const; \ |
3763
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3094
diff
changeset
|
182 |
template <typename T> \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
183 |
bool GetAccessor (T &value) const { \ |
3763
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3094
diff
changeset
|
184 |
value = T (m_value); \ |
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3094
diff
changeset
|
185 |
return true; \ |
e46e361a4262
give attribute power to Callback.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3094
diff
changeset
|
186 |
} \ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
187 |
virtual Ptr<AttributeValue> Copy (void) const; \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
188 |
virtual std::string \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
189 |
SerializeToString (Ptr<const AttributeChecker> checker) const; \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
190 |
virtual bool \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
191 |
DeserializeFromString (std::string value, \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
192 |
Ptr<const AttributeChecker> checker); \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
193 |
private: \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
194 |
type m_value; \ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
195 |
}; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
196 |
|
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
197 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
198 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
199 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
200 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
201 |
* Declare the attribute value class \p \<Name>Value |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
202 |
* for the class \p Name |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
203 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
204 |
* \param Name the name of the class. |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
205 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
206 |
* This macro declares the class \c NameValue associated to class \c Name. |
9897 | 207 |
* This macro is typically invoked in the class header file. |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
208 |
*/ |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
209 |
#define ATTRIBUTE_VALUE_DEFINE(Name) \ |
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
210 |
ATTRIBUTE_VALUE_DEFINE_WITH_NAME (Name,Name) |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
211 |
|
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
212 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
213 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
214 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
215 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
216 |
* Define the conversion operators class \p type and |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
217 |
* Attribute instances. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
218 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
219 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
220 |
* |
9897 | 221 |
* This macro defines the conversion operators for class \c type to and |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
222 |
* from instances of type Attribute. |
9897 | 223 |
* Typically invoked in the class header file. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
224 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
225 |
* \internal |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
226 |
* This appears to be unused. |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
227 |
*/ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
228 |
#define ATTRIBUTE_CONVERTER_DEFINE(type) |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
229 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
230 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
231 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
232 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
233 |
* Declare the AttributeChecker class \p \<type>Checker |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
234 |
* and the \c MakeTypeChecker function for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
235 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
236 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
237 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
238 |
* This macro declares the \p \<type>Checker class and the associated |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
239 |
* \c MakeTypeChecker function. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
240 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
241 |
* (Note that the \p \<type>Checker class needs no implementation |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
242 |
* since it just inherits all its implementation from AttributeChecker.) |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
243 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
244 |
* Typically invoked in the class header file. |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
245 |
*/ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
246 |
#define ATTRIBUTE_CHECKER_DEFINE(type) \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
247 |
class type ## Checker : public AttributeChecker {}; \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
248 |
Ptr<const AttributeChecker> Make ## type ## Checker (void) |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
249 |
|
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
250 |
|
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
251 |
/** |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
252 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
253 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
254 |
* Define the class methods belonging to |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
255 |
* the attribute value class \p \<name>Value |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
256 |
* of the underlying class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
257 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
258 |
* \param type The underlying type name |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
259 |
* \param name The token to use in defining the accessor name. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
260 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
261 |
* This macro implements the \p \<type>Value class methods |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
262 |
* (including the \p \<type>Value::SerializeToString |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
263 |
* and \p \<type>Value::DeserializeFromString methods). |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
264 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
265 |
* Typically invoked in the source file. |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
266 |
*/ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
267 |
#define ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type,name) \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
268 |
name ## Value::name ## Value () \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
269 |
: m_value () {} \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
270 |
name ## Value::name ## Value (const type &value) \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
271 |
: m_value (value) {} \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
272 |
void name ## Value::Set (const type &v) { \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
273 |
m_value = v; \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
274 |
} \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
275 |
type name ## Value::Get (void) const { \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
276 |
return m_value; \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
277 |
} \ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
278 |
Ptr<AttributeValue> \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
279 |
name ## Value::Copy (void) const { \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
280 |
return ns3::Create<name ## Value> (*this); \ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
281 |
} \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
282 |
std::string name ## Value::SerializeToString \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
283 |
(Ptr<const AttributeChecker> checker) const { \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
284 |
std::ostringstream oss; \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
285 |
oss << m_value; \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
286 |
return oss.str (); \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
287 |
} \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
288 |
bool name ## Value::DeserializeFromString \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
289 |
(std::string value, Ptr<const AttributeChecker> checker) { \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
290 |
std::istringstream iss; \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
291 |
iss.str (value); \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
292 |
iss >> m_value; \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
293 |
return !iss.bad () && !iss.fail (); \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
294 |
} |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
295 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
296 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
297 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
298 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
299 |
* Define the class methods belonging to |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
300 |
* attribute value class \p \<type>Value for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
301 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
302 |
* \param type the name of the class. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
303 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
304 |
* This macro implements the \p \<type>Value class methods |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
305 |
* (including the \p \<type>Value::SerializeToString |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
306 |
* and \p \<type>Value::DeserializeFromString methods). |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
307 |
* |
9897 | 308 |
* Typically invoked in the source file. |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
309 |
*/ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
310 |
#define ATTRIBUTE_VALUE_IMPLEMENT(type) \ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
311 |
ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME (type,type) |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2947
diff
changeset
|
312 |
|
2515
3f561ae03f89
add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2502
diff
changeset
|
313 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
314 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
315 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
316 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
317 |
* Define the \c MakeTypeChecker function for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
318 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
319 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
320 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
321 |
* This macro implements the \c MakeTypeChecker function. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
322 |
* |
9897 | 323 |
* Typically invoked in the source file.. |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
324 |
*/ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
325 |
#define ATTRIBUTE_CHECKER_IMPLEMENT(type) \ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
326 |
Ptr<const AttributeChecker> Make ## type ## Checker (void) { \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
327 |
return MakeSimpleAttributeChecker<type ## Value,type ## Checker> \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
328 |
(# type "Value", # type); \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
329 |
} \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
330 |
|
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
331 |
/** |
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
332 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
333 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
334 |
* Define the \c MakeTypeChecker function for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
335 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
336 |
* \param type the name of the class. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
337 |
* \param name the string name of the underlying type. |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
338 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
339 |
* This macro implements the \c MakeTypeChecker function |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
340 |
* for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
341 |
* |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
342 |
* Typically invoked in the source file.. |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
343 |
*/ |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
344 |
#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type,name) \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
345 |
Ptr<const AttributeChecker> Make ## type ## Checker (void) { \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
346 |
return MakeSimpleAttributeChecker<type ## Value,type ## Checker> \ |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
347 |
(# type "Value", name); \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
348 |
} \ |
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
349 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
350 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
351 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
352 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
353 |
* Declare the attribute value, accessor and checkers for class \p type |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
354 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
355 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
356 |
* |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
357 |
* This macro declares: |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
358 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
359 |
* - The attribute value class \p \<type>Value, |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
360 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
361 |
* - The attribute accessor functions \c MakeTypeAccessor, |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
362 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
363 |
* - The AttributeChecker class \p \<type>Checker |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
364 |
* and the \c MakeTypeChecker function, |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
365 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
366 |
* for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
367 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
368 |
* This macro should be invoked outside of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
369 |
* declaration in its public header. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
370 |
*/ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
371 |
#define ATTRIBUTE_HELPER_HEADER(type) \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
372 |
ATTRIBUTE_VALUE_DEFINE (type); \ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
373 |
ATTRIBUTE_ACCESSOR_DEFINE (type); \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
374 |
ATTRIBUTE_CHECKER_DEFINE (type); |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
375 |
|
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
376 |
/** |
9969
e813ecb3613d
[Doxygen] Collect Attribute docs into Core/Attributes
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9897
diff
changeset
|
377 |
* \ingroup attributehelper |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
378 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
379 |
* Define the attribute value, accessor and checkers for class \p type |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
380 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
381 |
* \param type the name of the class |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
382 |
* |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
383 |
* This macro implements |
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
384 |
* |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11035
diff
changeset
|
385 |
* - The \p \<type>Value class methods, |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
386 |
* |
10654
0148f9c47331
[doxygen] Make introspected lists more visible, various other doxy
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10602
diff
changeset
|
387 |
* - The \c MakeTypeChecker function, |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
388 |
* |
11035
4c13b42eabcd
[Doxygen] Attribute implementation.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10654
diff
changeset
|
389 |
* for class \p type. |
10602
c09b70543458
[doxygen] Fix some minor doxygen errors.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9969
diff
changeset
|
390 |
* |
2584
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
391 |
* This macro should be invoked from the class implementation file. |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
392 |
*/ |
5011c132ed6c
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
393 |
#define ATTRIBUTE_HELPER_CPP(type) \ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
394 |
ATTRIBUTE_CHECKER_IMPLEMENT (type); \ |
2439
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
395 |
ATTRIBUTE_VALUE_IMPLEMENT (type); |
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
396 |
|
4a0b22a3f5fa
UintValue -> Uinteger, IntValue -> Integer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
397 |
|
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2581
diff
changeset
|
398 |
#endif /* ATTRIBUTE_HELPER_H */ |