2017-07-10 00:00:57 +08:00
|
|
|
// The MIT License (MIT)
|
|
|
|
|
|
|
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
|
|
|
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
// this software and associated documentation files (the "Software"), to deal in
|
|
|
|
// the Software without restriction, including without limitation the rights to
|
|
|
|
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
// the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
// subject to the following conditions:
|
|
|
|
|
|
|
|
// The above copyright notice and this permission notice shall be included in all
|
|
|
|
// copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
#ifndef SOL_FORWARD_HPP
|
|
|
|
#define SOL_FORWARD_HPP
|
|
|
|
|
|
|
|
#include "feature_test.hpp"
|
|
|
|
|
|
|
|
namespace sol {
|
|
|
|
|
|
|
|
class reference;
|
|
|
|
class stack_reference;
|
2017-08-06 07:20:28 +08:00
|
|
|
struct proxy_base_tag;
|
2017-07-10 00:00:57 +08:00
|
|
|
template <typename Table, typename Key>
|
|
|
|
struct proxy;
|
|
|
|
template<typename T>
|
|
|
|
class usertype;
|
|
|
|
template<typename T>
|
|
|
|
class simple_usertype;
|
|
|
|
template <bool, typename T>
|
|
|
|
class basic_table_core;
|
|
|
|
template <bool b>
|
|
|
|
using table_core = basic_table_core<b, reference>;
|
|
|
|
template <bool b>
|
|
|
|
using stack_table_core = basic_table_core<b, stack_reference>;
|
|
|
|
template <typename T>
|
|
|
|
using basic_table = basic_table_core<false, T>;
|
|
|
|
typedef table_core<false> table;
|
|
|
|
typedef table_core<true> global_table;
|
|
|
|
typedef stack_table_core<false> stack_table;
|
|
|
|
typedef stack_table_core<true> stack_global_table;
|
|
|
|
template <typename base_t>
|
|
|
|
struct basic_environment;
|
|
|
|
using environment = basic_environment<reference>;
|
|
|
|
using stack_environment = basic_environment<stack_reference>;
|
2017-08-06 07:20:28 +08:00
|
|
|
template <typename T, bool>
|
2017-07-10 00:00:57 +08:00
|
|
|
class basic_function;
|
2017-08-07 00:20:32 +08:00
|
|
|
template <typename T, bool, typename H>
|
2017-07-10 00:00:57 +08:00
|
|
|
class basic_protected_function;
|
2017-08-06 07:20:28 +08:00
|
|
|
using unsafe_function = basic_function<reference, false>;
|
2017-08-07 00:20:32 +08:00
|
|
|
using safe_function = basic_protected_function<reference, false, reference>;
|
2017-08-06 07:20:28 +08:00
|
|
|
using stack_unsafe_function = basic_function<stack_reference, false>;
|
2017-08-07 00:20:32 +08:00
|
|
|
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
|
2017-08-06 07:20:28 +08:00
|
|
|
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
|
2017-08-07 00:20:32 +08:00
|
|
|
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
|
2017-08-06 07:20:28 +08:00
|
|
|
using protected_function = safe_function;
|
|
|
|
using stack_protected_function = stack_safe_function;
|
|
|
|
using stack_aligned_protected_function = stack_aligned_safe_function;
|
2017-07-10 00:00:57 +08:00
|
|
|
#ifdef SOL_SAFE_FUNCTIONS
|
|
|
|
using function = protected_function;
|
|
|
|
using stack_function = stack_protected_function;
|
2017-08-06 07:20:28 +08:00
|
|
|
using stack_aligned_function = stack_aligned_safe_function;
|
2017-07-10 00:00:57 +08:00
|
|
|
#else
|
|
|
|
using function = unsafe_function;
|
|
|
|
using stack_function = stack_unsafe_function;
|
2017-08-06 07:20:28 +08:00
|
|
|
using stack_aligned_function = stack_aligned_unsafe_function;
|
2017-07-10 00:00:57 +08:00
|
|
|
#endif
|
2017-08-07 00:20:32 +08:00
|
|
|
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
|
|
|
|
|
2017-08-06 07:20:28 +08:00
|
|
|
struct function_result;
|
|
|
|
struct protected_function_result;
|
|
|
|
using safe_function_result = protected_function_result;
|
|
|
|
using unsafe_function_result = function_result;
|
2017-07-10 00:00:57 +08:00
|
|
|
template <typename base_t>
|
|
|
|
class basic_object;
|
|
|
|
template <typename base_t>
|
|
|
|
class basic_userdata;
|
|
|
|
template <typename base_t>
|
|
|
|
class basic_lightuserdata;
|
|
|
|
using object = basic_object<reference>;
|
|
|
|
using stack_object = basic_object<stack_reference>;
|
|
|
|
using userdata = basic_userdata<reference>;
|
|
|
|
using stack_userdata = basic_userdata<stack_reference>;
|
|
|
|
using lightuserdata = basic_lightuserdata<reference>;
|
|
|
|
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
|
|
|
|
class coroutine;
|
|
|
|
class thread;
|
|
|
|
struct variadic_args;
|
|
|
|
struct variadic_results;
|
2017-08-06 07:20:28 +08:00
|
|
|
struct stack_count;
|
2017-07-10 00:00:57 +08:00
|
|
|
struct this_state;
|
|
|
|
struct this_environment;
|
|
|
|
template <typename T>
|
2017-08-06 07:20:28 +08:00
|
|
|
struct as_table_t;
|
|
|
|
template <typename T>
|
2017-08-11 21:40:56 +08:00
|
|
|
struct as_container_t;
|
|
|
|
template <typename T>
|
2017-08-06 07:20:28 +08:00
|
|
|
struct nested;
|
|
|
|
template <typename T>
|
2017-07-10 00:00:57 +08:00
|
|
|
struct light;
|
|
|
|
template <typename T>
|
|
|
|
struct user;
|
|
|
|
template <typename T>
|
|
|
|
struct as_args_t;
|
2017-08-22 03:25:43 +08:00
|
|
|
template <typename T>
|
|
|
|
struct protect_t;
|
|
|
|
template <typename F, typename... Filters>
|
|
|
|
struct filter_wrapper;
|
2017-07-10 00:00:57 +08:00
|
|
|
} // sol
|
|
|
|
|
2017-07-10 00:59:28 +08:00
|
|
|
#endif // SOL_FORWARD_HPP
|