/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ //osgIntrospection - Copyright (C) 2005 Marco Jez #ifndef OSGINTROSPECTION_INSTANCECREATOR_ #define OSGINTROSPECTION_INSTANCECREATOR_ #include #include namespace osgIntrospection { /// The ObjectInstanceCreator struct template is a collection of /// static methods that provide the means for creating instances /// of object types dynamically. Such methods are usually called /// from within TypedConstructorInfo{n}::createInstance(). template struct ObjectInstanceCreator { template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12, Value& a13, Value& a14, Value& a15) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12), variant_cast(a13), variant_cast(a14), variant_cast(a15)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12, Value& a13, Value& a14) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12), variant_cast(a13), variant_cast(a14)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12, Value& a13) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12), variant_cast(a13)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3)); } template static Value create(Value& a0, Value& a1, Value& a2) { return new T(variant_cast(a0), variant_cast(a1), variant_cast(a2)); } template static Value create(Value& a0, Value& a1) { return new T(variant_cast(a0), variant_cast(a1)); } template static Value create(Value& a0) { return new T(variant_cast(a0)); } static Value create() { return new T(); } }; template struct ValueInstanceCreator { template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12, Value& a13, Value& a14, Value& a15) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12), variant_cast(a13), variant_cast(a14), variant_cast(a15)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12, Value& a13, Value& a14) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12), variant_cast(a13), variant_cast(a14)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12, Value& a13) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12), variant_cast(a13)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11, Value& a12) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11), variant_cast(a12)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10, Value& a11) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10), variant_cast(a11)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9, Value& a10) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9), variant_cast(a10)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8, Value& a9) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8), variant_cast(a9)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7, Value& a8) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7), variant_cast(a8)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6, Value& a7) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6), variant_cast(a7)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5, Value& a6) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5), variant_cast(a6)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4, Value& a5) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4), variant_cast(a5)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3, Value& a4) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3), variant_cast(a4)); } template static Value create(Value& a0, Value& a1, Value& a2, Value& a3) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2), variant_cast(a3)); } template static Value create(Value& a0, Value& a1, Value& a2) { return T(variant_cast(a0), variant_cast(a1), variant_cast(a2)); } template static Value create(Value& a0, Value& a1) { return T(variant_cast(a0), variant_cast(a1)); } template static Value create(Value& a0) { return T(variant_cast(a0)); } static Value create() { return T(); } }; template struct DummyInstanceCreator { template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& , Value& ) { return Value(); } template static Value create(Value& , Value& ) { return Value(); } template static Value create(Value& ) { return Value(); } static Value create() { return Value(); } }; template struct ProtectedConstructorInstanceCreator { template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& , Value& ) { throw ProtectedConstructorInvocationException(); } template static Value create(Value& ) { throw ProtectedConstructorInvocationException(); } static Value create() { throw ProtectedConstructorInvocationException(); } }; } #endif