DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::oksdalgen::NameSpaceInfo Struct Reference

#include <class_info.hpp>

Public Member Functions

bool empty () const
void add (const std::string &ns_name, const std::string &class_name)
void print (std::ostream &s, int level) const

Public Attributes

std::set< std::string > m_classes
std::map< std::string, NameSpaceInfom_nested

Detailed Description

Definition at line 49 of file class_info.hpp.

Member Function Documentation

◆ add()

void dunedaq::oksdalgen::NameSpaceInfo::add ( const std::string & ns_name,
const std::string & class_name )
inline

Definition at line 61 of file class_info.hpp.

62 {
63 if (!ns_name.empty())
64 {
65 std::string::size_type idx = ns_name.find_first_of(':');
66 NameSpaceInfo &ns = m_nested[ns_name.substr(0, idx)];
67 if (idx != std::string::npos)
68 ns.add(ns_name.substr(ns_name.find_first_not_of(':', idx)), class_name);
69 else
70 ns.add("", class_name);
71 }
72 else
73 m_classes.insert(class_name);
74 }
std::map< std::string, NameSpaceInfo > m_nested
std::set< std::string > m_classes

◆ empty()

bool dunedaq::oksdalgen::NameSpaceInfo::empty ( ) const
inline

Definition at line 55 of file class_info.hpp.

56 {
57 return (m_classes.empty() && m_nested.empty());
58 }

◆ print()

void dunedaq::oksdalgen::NameSpaceInfo::print ( std::ostream & s,
int level ) const
inline

Definition at line 77 of file class_info.hpp.

78 {
79 std::string dx(level * 2, ' ');
80
81 for (const auto &x : m_nested)
82 {
83 s << dx << "namespace " << x.first << " {\n";
84 x.second.print(s, level + 1);
85 s << dx << "}\n";
86 }
87
88 for (const auto &x : m_classes)
89 s << dx << "class " << x << ";\n";
90 }

Member Data Documentation

◆ m_classes

std::set<std::string> dunedaq::oksdalgen::NameSpaceInfo::m_classes

Definition at line 51 of file class_info.hpp.

◆ m_nested

std::map<std::string, NameSpaceInfo> dunedaq::oksdalgen::NameSpaceInfo::m_nested

Definition at line 52 of file class_info.hpp.


The documentation for this struct was generated from the following file: