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, NameSpaceInfo > m_nested

Detailed Description

Definition at line 46 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 53 of file class_info.hpp.

54 {
55 if (!ns_name.empty()) {
56 std::string::size_type idx = ns_name.find_first_of(':');
57 NameSpaceInfo& ns = m_nested[ns_name.substr(0, idx)];
58 if (idx != std::string::npos)
59 ns.add(ns_name.substr(ns_name.find_first_not_of(':', idx)), class_name);
60 else
61 ns.add("", class_name);
62 } else
63 m_classes.insert(class_name);
64 }
std::map< std::string, NameSpaceInfo > m_nested
std::set< std::string > m_classes

◆ empty()

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

Definition at line 51 of file class_info.hpp.

51{ return (m_classes.empty() && m_nested.empty()); }

◆ print()

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

Definition at line 66 of file class_info.hpp.

67 {
68 std::string dx(level * 2, ' ');
69
70 for (const auto& x : m_nested) {
71 s << dx << "namespace " << x.first << " {\n";
72 x.second.print(s, level + 1);
73 s << dx << "}\n";
74 }
75
76 for (const auto& x : m_classes)
77 s << dx << "class " << x << ";\n";
78 }

Member Data Documentation

◆ m_classes

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

Definition at line 48 of file class_info.hpp.

◆ m_nested

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

Definition at line 49 of file class_info.hpp.


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