ScopedNamespaceGuard Struct Reference

#include <dds_generator.h>

Collaboration diagram for ScopedNamespaceGuard:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ScopedNamespaceGuard (UTL_ScopedName *name, std::ostream &os, const char *keyword="namespace")
 ~ScopedNamespaceGuard ()

Public Attributes

std::ostream & os_
std::string semi_
int n_

Detailed Description

Definition at line 153 of file dds_generator.h.


Constructor & Destructor Documentation

ScopedNamespaceGuard::ScopedNamespaceGuard ( UTL_ScopedName *  name,
std::ostream &  os,
const char *  keyword = "namespace" 
) [inline]

Definition at line 154 of file dds_generator.h.

References n_, semi_, and str.

00156     : os_(os)
00157   {
00158     for (n_ = 0; name->tail();
00159          name = static_cast<UTL_ScopedName*>(name->tail())) {
00160       const char* str = name->head()->get_string();
00161       if (str && str[0]) {
00162         ++n_;
00163         os << keyword << (name->head()->escaped() ? " _" : " ")
00164            << str << " {\n";
00165       }
00166     }
00167     if (std::strcmp(keyword, "module") == 0) semi_ = ";";
00168   }

ScopedNamespaceGuard::~ScopedNamespaceGuard (  )  [inline]

Definition at line 170 of file dds_generator.h.

References n_, os_, and semi_.

00171   {
00172     for (int i = 0; i < n_; ++i) os_ << '}' << semi_ << '\n';
00173   }


Member Data Documentation

Definition at line 177 of file dds_generator.h.

Referenced by ScopedNamespaceGuard(), and ~ScopedNamespaceGuard().

Definition at line 175 of file dds_generator.h.

Referenced by ~ScopedNamespaceGuard().

Definition at line 176 of file dds_generator.h.

Referenced by ScopedNamespaceGuard(), and ~ScopedNamespaceGuard().


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1