Macros

Line Code
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#ifndef Fireworks_Core_register_dataproxybuilder_macro_h
#define Fireworks_Core_register_dataproxybuilder_macro_h
// -*- C++ -*-
//
// Package:     Core
// Class  :     register_dataproxybuilder_macro
//
/**

   Description: Adds needed methods to a ProxyBuilder

   Usage:
    <usage>

 */
//
// Original Author:  Chris Jones
//         Created:  Thu Jun  5 15:31:20 EDT 2008
//

// system include files
#include <cstdlib>
#include <string>

// user include files
#include "FWCore/Reflection/interface/TypeWithDict.h"
#include "FWCore/Utilities/interface/concatenate.h"

// forward declarations

#define REGISTER_PROXYBUILDER_METHODS()                           \
  const std::string& typeName() const { return classTypeName(); } \
  const std::string& view() const { return classView(); }         \
  const std::string& purpose() const { return classPurpose(); }   \
  static const std::string& classRegisterTypeName();              \
  static const std::string& classTypeName();                      \
  static const std::string& classPurpose();                       \
  static const std::string& classView()

#define DEFINE_PROXYBUILDER_METHODS(_builder_, _type_, _purpose_, _view_) \
  const std::string& _builder_::classTypeName() {                         \
    static std::string s_type = edm::TypeWithDict(typeid(_type_)).name(); \
    return s_type;                                                        \
  }                                                                       \
  const std::string& _builder_::classRegisterTypeName() {                 \
    static std::string s_type(typeid(_type_).name());                     \
    return s_type;                                                        \
  }                                                                       \
  const std::string& _builder_::classView() {                             \
    static std::string s_view(std::to_string(_view_));                    \
    return s_view;                                                        \
  }                                                                       \
  const std::string& _builder_::classPurpose() {                          \
    static std::string s_purpose(_purpose_);                              \
    return s_purpose;                                                     \
  }                                                                       \
  enum { EDM_CONCATENATE(dummy_proxybuilder_methods_, __LINE__) }

#endif