summaryrefslogtreecommitdiff
path: root/CIAO/CIDLC/ParameterEmitter_T.hpp
blob: 4fe0d55867f4bf18e0a993a63eb83077cbf8a2aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// file      : CIDLC/ParameterEmitter_T.hpp
// author    : Jeff Parsons <j.parsons@vanderbilt.edu>
// cvs-id    : $Id$

#ifndef PARAMETEREMITTER_T_HPP
#define PARAMETEREMITTER_T_HPP

#include "EmitterBase.hpp"

// For generating parameter names.
template <typename T>
struct ParameterEmitter : T, EmitterBase
{
  ParameterEmitter (Context& c, bool for_exec_src = false)
    : EmitterBase (c),
      for_exec_src_ (for_exec_src)
  {
  }

  virtual void
  name (typename T::Type& p)
  {
    os << " "
       << (for_exec_src_ ? "/* " : "")
       << p.name ()
       << (for_exec_src_ ? " */" : "");
  }

private:
  bool for_exec_src_;
};

#endif  // PARAMETEREMITTER_T_HPP