5 #include "ns3/object.h"
6 #include "ns3/pointer.h"
7 #include "ns3/object-vector.h"
8 #include "ns3/config.h"
10 #include "ns3/global-value.h"
11 #include "ns3/string.h"
12 #include "ns3/node-container.h"
13 #include "ns3/csma-channel.h"
61 << info.
help << std::endl;
64 if (info.
checker->HasUnderlyingTypeInformation ())
67 if ( (info.
checker->GetValueTypeName () !=
"ns3::EnumValue")
68 && (info.
checker->GetUnderlyingTypeInformation () !=
"std::string")
93 os <<
" " <<
listStop <<
" " << std::endl;
127 void RecordAggregationInfo (std::string a, std::string b);
137 void Print (
void)
const;
144 std::vector<std::string> Get (
TypeId tid);
150 std::string GetCurrentPath (
void)
const;
156 void DoGather (
TypeId tid);
162 void RecordOutput (
TypeId tid);
168 bool HasAlreadyBeenProcessed (
TypeId tid)
const;
176 void find_and_replace (std::string &source,
const std::string find, std::string replace );
180 std::vector<std::pair<TypeId,std::string> >
m_output;
204 for (std::vector<std::pair<TypeId,std::string> >::const_iterator i = m_output.begin (); i != m_output.end (); ++i)
206 std::pair<TypeId,std::string> item = *i;
207 std::cout << item.first.GetName () <<
" -> " << item.second << std::endl;
214 std::ostringstream oss;
215 for (std::vector<std::string>::const_iterator i = m_currentPath.begin (); i != m_currentPath.end (); ++i)
217 std::string item = *i;
226 m_output.push_back (std::make_pair (tid, GetCurrentPath ()));
232 for (uint32_t i = 0; i < m_alreadyProcessed.size (); ++i)
234 if (m_alreadyProcessed[i] == tid)
242 std::vector<std::string>
245 std::vector<std::string> paths;
246 for (uint32_t i = 0; i < m_output.size (); ++i)
248 std::pair<TypeId,std::string> tmp = m_output[i];
249 if (tmp.first == tid)
251 paths.push_back (tmp.second);
262 std::sort (m_output.begin (), m_output.end ());
263 m_output.erase (std::unique (m_output.begin (), m_output.end ()), m_output.end ());
270 if (HasAlreadyBeenProcessed (tid))
285 TypeId objectTypeId =
object->GetTypeId ();
286 if (objectTypeId == pointee)
295 m_currentPath.push_back (info.
name);
296 m_alreadyProcessed.push_back (tid);
298 m_alreadyProcessed.pop_back ();
299 m_currentPath.pop_back ();
304 if (vectorChecker != 0)
307 m_currentPath.push_back (info.
name +
"/[i]");
308 m_alreadyProcessed.push_back (tid);
310 m_alreadyProcessed.pop_back ();
311 m_currentPath.pop_back ();
323 find_and_replace(childName,
"::",replaceWith);
324 m_currentPath.push_back (childName);
325 m_alreadyProcessed.push_back (tid);
327 m_alreadyProcessed.pop_back ();
328 m_currentPath.pop_back ();
331 for (uint32_t k = 0; k < m_aggregates.size (); ++k)
333 std::pair<TypeId,TypeId> tmp = m_aggregates[k];
334 if (tmp.first == tid || tmp.second == tid)
337 if (tmp.first == tid)
341 if (tmp.second == tid)
359 find_and_replace(name,
"::",replaceWith);
360 m_currentPath.push_back (name);
361 m_alreadyProcessed.push_back (tid);
363 m_alreadyProcessed.pop_back ();
364 m_currentPath.pop_back ();
373 j = source.find (find);
374 while (j != std::string::npos )
376 source.replace (j, find.length (),replace);
377 j = source.find (find,j+1);
384 std::cout <<
"Usage: " << program_name <<
" [options]" << std::endl
386 <<
"Options:" << std::endl
387 <<
" --help : print these options" << std::endl
388 <<
" --output-text : format output as plain text" << std::endl;
391 int main (
int argc,
char *argv[])
393 bool outputText =
false;
394 char *programName = argv[0];
402 if (strcmp (arg,
"--help") == 0)
407 else if (strcmp(arg,
"--output-text") == 0)
429 commentStart =
"===============================================================\n";
510 csma = CreateObject<CsmaChannel> ();
518 std::map< std::string, uint32_t> nameMap;
519 std::map< std::string, uint32_t>::const_iterator nameMapIterator;
533 std::string name = tid.
GetName ();
534 for (uint32_t j = 0; j < name.length (); j++)
536 name[j] = toupper (name[j]);
545 for (nameMapIterator = nameMap.begin ();
546 nameMapIterator != nameMap.end ();
550 uint32_t i = nameMapIterator->second;
559 std::cout << std::endl;
560 std::vector<std::string> paths = info.
Get (tid);
565 std::cout <<
"Doxygen introspection did not find any typical Config paths."
573 std::cout << std::endl;
575 <<
" is accessible through the following paths"
576 <<
" with Config::Set and Config::Connect:"
579 for (uint32_t k = 0; k < paths.size (); ++k)
581 std::string path = paths[k];
591 std::cout <<
"No Attributes are defined for this type."
606 <<
"Attributes defined in parent class "
618 std::cout <<
"No TraceSources are defined for this type."
634 <<
"TraceSources defined in parent class "
708 (*i)->GetValue (val);
713 <<
"GlobalValue" << (*i)->GetName () <<
" " << (*i)->GetName ()
715 <<
": " << (*i)->GetHelp () <<
". Default value: " << val.
Get () <<
"."
void PrintAttributes(TypeId tid, std::ostream &os)
uint32_t GetAttributeN(void) const
void PrintTraceSources(TypeId tid, std::ostream &os)
#define NS_LOG_FUNCTION(parameters)
std::string Get(void) const
std::string functionStop
end of a class/function
virtual TypeId GetInstanceTypeId(void) const
std::string headingStop
end of section heading (h3)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
hold variables of type string
std::string defgroupAttributeListStop
end of AttributeList group
std::string defgroupTraceSourceListStart
start of TraceSourceList group
std::string defgroupGlobalValueListStop
end of GlobalValueList group
std::string headingStart
start of section heading (h3)
virtual TypeId GetPointeeTypeId(void) const =0
std::string flagSpanStart
start of Attribute flag value
TypeId GetParent(void) const
Vector::const_iterator Iterator
std::string boldStart
start of bold span
std::string commentStop
end of code comment
The attribute can be written at construction-time.
virtual TypeId GetItemTypeId(void) const =0
Ptr< Object > GetRootNamespaceObject(uint32_t i)
std::string listLineStart
start unordered list item
std::string breakTextOnly
linebreak for text output only
The attribute can be read.
bool MustHideFromDocumentation(void) const
std::string indentHtmlOnly
small indent
int main(int argc, char *argv[])
std::string defgroupGlobalValueListStart
start of GlobalValueList group
std::string defgroupTraceSourceListStop
end of TraceSourceList group
std::string brief
brief tag
static uint32_t GetRegisteredN(void)
void PrintHelp(const char *program_name)
static Iterator Begin(void)
T * PeekPointer(const Ptr< T > &p)
uint32_t GetTraceSourceN(void) const
static TypeId GetRegistered(uint32_t i)
std::string breakHtmlOnly
linebreak for html output only
keep track of a set of node pointers.
The attribute can be written.
std::string listLineStop
end unordered list item
std::string reference
reference tag
std::string GetName(void) const
std::string listStart
start unordered list
std::string listStop
end unordered list
std::string temporaryCharacter
"%" placeholder
std::string anchor
hyperlink anchor
std::string ingroupConstructs
add to constructs group
static Iterator End(void)
uint32_t GetRootNamespaceObjectN(void)
bool IsChildOf(TypeId other) const
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
std::string defgroupAttributeListStart
start of AttributeList group
struct TypeId::TraceSourceInformation GetTraceSource(uint32_t i) const
std::string functionStart
start of a class/function
struct TypeId::AttributeInformation GetAttribute(uint32_t i) const
std::string breakBoth
linebreak
std::string flagSpanStop
end of Attribute flag value
a unique identifier for an interface.
std::string boldStop
end of bold span
std::string commentStart
start of code comment
static TypeId LookupByName(std::string name)