-#ifndef __@prj_NAME@__h__
-#define __@prj_NAME@__h__
+// =========================================================================
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// =========================================================================
+#ifndef __cpPlugins__Config__h__
+#define __cpPlugins__Config__h__
-#define ITK_MANUAL_INSTANTIATION
-#include <@prj_NAME@_Export.h>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <sstream>
#include <stdexcept>
+#include <cpPlugins_Export.h>
-/*
- * =========================================================================
- * Identify OS
- * =========================================================================
- */
-#define @prj_NAME_OS@
-#define @prj_NAME@_LIB_PREFIX "@prj_NAME_LIB_PREFIX@"
-#define @prj_NAME@_LIB_EXT "@prj_NAME_LIB_EXT@"
-#define @prj_NAME@_ENV_SEPARATOR "@prj_NAME_ENV_SEPARATOR@"
-#define @prj_NAME@_PATH_SEPARATOR "@prj_NAME_PATH_SEPARATOR@"
+// =========================================================================
+// Identify OS
+// =========================================================================
-#ifdef @prj_NAME@_OS_Windows
+#define cpPlugins_OS_@CMAKE_SYSTEM_NAME@
+#define cpPlugins_LIB_EXT "@CMAKE_SHARED_LIBRARY_SUFFIX@"
+#define cpPlugins_LIB_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@"
+#define cpPlugins_ENV "cpPlugins_PATH"
+#define cpPlugins_EXT ".plg"
+
+#ifdef cpPlugins_OS_Windows
+# define cpPlugins_ENV_SEP ";"
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
-# endif
+# endif // WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <windows.h>
# include <tchar.h>
-#endif // @prj_NAME@_OS_Windows
-
-/*
- * =========================================================================
- * Some global values
- * =========================================================================
- */
-
-#define @prj_NAME@_PATHS "@prj_NAME@_PATHS"
-#define @prj_NAME@_CONFIG "@prj_NAME@_Libraries.config"
-#define @prj_NAME@_QT4_USED @QT4_FOUND@
-#if @prj_NAME@_QT4_USED == 1
-# define @prj_NAME@_QT4
-# define @prj_NAME@_QVTKWidget @cpPlugins_Qt4_VTKWidget@
-# include <@cpPlugins_Qt4_VTKWidget@.h>
-#else // @prj_NAME@_QT4_USED == 1
-# undef @prj_NAME@_QT4
-#endif // @prj_NAME@_QT4_USED == 1
+#else // cpPlugins_OS_Windows
+# define cpPlugins_ENV_SEP ":"
+#endif // cpPlugins_OS_Windows
-/*
- * =========================================================================
- * Version numbers and strings
- * =========================================================================
- */
+// =========================================================================
+// Some generic macros
+// =========================================================================
-#define @prj_NAME@_MAJOR_VERSION @prj_MAJ_VER@
-#define @prj_NAME@_MINOR_VERSION @prj_MIN_VER@
-#define @prj_NAME@_RELEASE_VERSION @prj_REL_VER@
-#define @prj_NAME@_VERSION "@prj_VERSION@"
-#define @prj_NAME@_SHORT_VERSION "@prj_SHORT_VERSION@"
-#define @prj_NAME@_OpenGL_BackEnd_@VTK_RENDERING_BACKEND@
-
-/*
- * =========================================================================
- * Language related macros
- * =========================================================================
- */
-
-#if __cplusplus >= 201103L
-# define @prj_NAME@_OVERRIDE override
-# define @prj_NAME@_DELETE_FUNCTION =delete
-# define @prj_NAME@_NULLPTR nullptr
-# define @prj_NAME@_NOEXCEPT noexcept
-# define @prj_NAME@_HAS_CXX11_STATIC_ASSERT
-# define @prj_NAME@_HAS_CXX11_RVREF
-#else // __cplusplus >= 201103L
-# define @prj_NAME@_OVERRIDE
-# define @prj_NAME@_DELETE_FUNCTION
-# define @prj_NAME@_NULLPTR NULL
-# define @prj_NAME@_NOEXCEPT throw()
-#endif // __cplusplus >= 201103L
+#define _cpPluginsErrorMacro_2( CPPLUGINS_OBJECT, CPPLUGINS_MESSAGE ) \
+ { \
+ std::stringstream _cpPlugins_error_message_; \
+ _cpPlugins_error_message_ \
+ << "Error in \"" << __FILE__ \
+ << "\", line \"" << __LINE__ << "\": "; \
+ if( CPPLUGINS_OBJECT != NULL ) \
+ { \
+ const cpPlugins::ProcessObject* _cpPlugins_Object = \
+ reinterpret_cast< const cpPlugins::ProcessObject* >( \
+ CPPLUGINS_OBJECT \
+ ); \
+ _cpPlugins_error_message_ \
+ << "\"" \
+ << _cpPlugins_Object->GetName( ) << "\"@\"" \
+ << _cpPlugins_Object->GetClassName( ) << "\": "; \
+ } \
+ _cpPlugins_error_message_ CPPLUGINS_MESSAGE; \
+ throw std::runtime_error( _cpPlugins_error_message_.str( ) ); \
+ }
-/*
- * =========================================================================
- * Some macros
- * =========================================================================
- */
+#define _cpPluginsErrorMacro_1( CPPLUGINS_MESSAGE ) \
+ { \
+ std::stringstream _cpPlugins_error_message_; \
+ _cpPlugins_error_message_ \
+ << "Error in \"" << __FILE__ \
+ << "\", line \"" << __LINE__ << "\": "; \
+ _cpPlugins_error_message_ CPPLUGINS_MESSAGE; \
+ throw std::runtime_error( _cpPlugins_error_message_.str( ) ); \
+ }
-#define @prj_NAME@_Id_Macro( _class, _category ) \
- public: \
- virtual const char* GetClassName( ) const @prj_NAME@_OVERRIDE \
- { return( #_class ); } \
- virtual const char* GetClassCategory( ) const @prj_NAME@_OVERRIDE \
- { return( #_category ); }
+#define _cpPluginsErrorMacro_0( ) \
+ _cpPluginsErrorMacro_1( << "Unknown error." )
-#define @prj_NAME@Object( _cls, _scls, _cat ) \
- public: \
- typedef _cls Self; \
- typedef _scls Superclass; \
- typedef itk::SmartPointer< Self > Pointer; \
- typedef itk::SmartPointer< const Self > ConstPointer; \
- public: \
- itkNewMacro( Self ); \
- itkTypeMacro( _cls, _scls ); \
- public: \
- virtual const char* GetClassName( ) const @prj_NAME@_OVERRIDE \
- { return( #_cls ); } \
- virtual const char* GetClassCategory( ) const @prj_NAME@_OVERRIDE \
- { return( #_cat ); } \
- protected: \
- _cls( ); \
- virtual ~_cls( ); \
- virtual void _GenerateData( ) @prj_NAME@_OVERRIDE; \
- private: \
- _cls( const Self& ); \
- Self& operator=( const Self& )
+#define _cpPluginsErrorMacro_( x, A, B, FUNC, ... ) FUNC
-#define @prj_NAME@_Compatibility_Macro \
- virtual bool IsCompatible( \
- const DataObject* other \
- ) const @prj_NAME@_OVERRIDE \
- { \
- return( dynamic_cast< const Self* >( other ) != NULL ); \
- }
+#define cpPluginsErrorMacro( ... ) \
+ _cpPluginsErrorMacro_(, ##__VA_ARGS__, \
+ _cpPluginsErrorMacro_2(__VA_ARGS__), \
+ _cpPluginsErrorMacro_1(__VA_ARGS__), \
+ _cpPluginsErrorMacro_0(__VA_ARGS__) \
+ )
-#endif // __@prj_NAME@__h__
+#endif // __cpPlugins__Config__h__
// eof - $RCSfile$