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 42 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 54 of file class_info.hpp.

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

◆ empty()

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

Definition at line 48 of file class_info.hpp.

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

◆ print()

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

Definition at line 70 of file class_info.hpp.

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

Member Data Documentation

◆ m_classes

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

Definition at line 44 of file class_info.hpp.

◆ m_nested

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

Definition at line 45 of file class_info.hpp.


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