Project

General

Profile

Actions

Bug #1181

open

register factories bug

Added by Jules Waldhart over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Start date:
2018-05-24
Due date:
% Done:

0%

Estimated time:

Description

Need to define the macro to register factories that way:

#define CONCAT_IMPL(x,y) x##y
#define MACRO_CONCAT(x,y) CONCAT_IMPL(x,y)
//credits to github.com/ros/class_loader for the macro
#define LOCALPATH_REGISTER_CREATOR_INTERNAL(Derived, UniqueID) \
namespace \
{\
  struct MACRO_CONCAT(ProxyExec,UniqueID) \
  {\
    typedef  Derived _derived; \
    MACRO_CONCAT(ProxyExec,UniqueID)() \
    { \
      ::move4d::API::LocalpathFactory::instance()->registerFactory(#Derived, new ::move4d::API::LocalPathBaseCreator<_derived>()); \
    }\
  };\
  static MACRO_CONCAT(ProxyExec,UniqueID) MACRO_CONCAT(g_register_plugin_,UniqueID);\
}
#define LOCALPATH_REGISTER_FACTORY(localpath_class)\
    LOCALPATH_REGISTER_CREATOR_INTERNAL(localpath_class,__COUNTER__)

Actions

Also available in: Atom PDF