Jpp
JConstructor.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JCONSTRUCTOR__
2 #define __JLANG__JCONSTRUCTOR__
3 
4 #include "JLang/JTest.hh"
5 
6 /**
7  * \author mdejong
8  */
9 
10 namespace JLANG {}
11 namespace JPP { using namespace JLANG; }
12 
13 namespace JLANG {
14 
15  /**
16  * Template class test for availability of a suitable constructor <tt>JType_t(const JArgument_t)</tt>.
17  */
18  template<class JType_t, class JArgument_t>
19  class JConstructor :
20  public JTest
21  {
22  using JTest::test;
23 
24  static JTrue test(const JType_t&);
25 
26  static const JArgument_t& getReference();
27 
28  public:
29  static const bool has_constructor = JTEST(test(getReference())); //!< true if JType_t can be constructed from JArgument_t; else false
30  };
31 }
32 
33 #endif
JLANG::JConstructor::getReference
static const JArgument_t & getReference()
JLANG::JTest::JTrue
definition of true
Definition: JTest.hh:24
JLANG::JTest::test
static JFalse test(...)
default false
JLANG::JTest
Auxiliary base class for compile time evaluation of test.
Definition: JTest.hh:21
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTEST
#define JTEST(__A__)
Test macro.
Definition: JTest.hh:45
JLANG::JConstructor::has_constructor
static const bool has_constructor
true if JType_t can be constructed from JArgument_t; else false
Definition: JConstructor.hh:29
JLANG::JConstructor::test
static JTrue test(const JType_t &)
JLANG::JConstructor
Template class test for availability of a suitable constructor JType_t(const JArgument_t).
Definition: JConstructor.hh:19
JLANG
Auxiliary classes and methods for language specific functionality.
Definition: JAbstractClass.hh:10
JTest.hh