godot/core/templates/command_queue_mt.h

/**************************************************************************/
/*  command_queue_mt.h                                                    */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* 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 COMMAND_QUEUE_MT_H
#define COMMAND_QUEUE_MT_H

#include "core/object/worker_thread_pool.h"
#include "core/os/condition_variable.h"
#include "core/os/memory.h"
#include "core/os/mutex.h"
#include "core/string/print_string.h"
#include "core/templates/local_vector.h"
#include "core/templates/simple_type.h"
#include "core/typedefs.h"

#define COMMA(N)
#define _COMMA_0
#define _COMMA_1
#define _COMMA_2
#define _COMMA_3
#define _COMMA_4
#define _COMMA_5
#define _COMMA_6
#define _COMMA_7
#define _COMMA_8
#define _COMMA_9
#define _COMMA_10
#define _COMMA_11
#define _COMMA_12
#define _COMMA_13
#define _COMMA_14
#define _COMMA_15

// 1-based comma separated list of ITEMs
#define COMMA_SEP_LIST(ITEM, LENGTH)
#define _COMMA_SEP_LIST_15(ITEM)
#define _COMMA_SEP_LIST_14(ITEM)
#define _COMMA_SEP_LIST_13(ITEM)
#define _COMMA_SEP_LIST_12(ITEM)
#define _COMMA_SEP_LIST_11(ITEM)
#define _COMMA_SEP_LIST_10(ITEM)
#define _COMMA_SEP_LIST_9(ITEM)
#define _COMMA_SEP_LIST_8(ITEM)
#define _COMMA_SEP_LIST_7(ITEM)
#define _COMMA_SEP_LIST_6(ITEM)
#define _COMMA_SEP_LIST_5(ITEM)
#define _COMMA_SEP_LIST_4(ITEM)
#define _COMMA_SEP_LIST_3(ITEM)
#define _COMMA_SEP_LIST_2(ITEM)
#define _COMMA_SEP_LIST_1(ITEM)
#define _COMMA_SEP_LIST_0(ITEM)

// 1-based semicolon separated list of ITEMs
#define SEMIC_SEP_LIST(ITEM, LENGTH)
#define _SEMIC_SEP_LIST_15(ITEM)
#define _SEMIC_SEP_LIST_14(ITEM)
#define _SEMIC_SEP_LIST_13(ITEM)
#define _SEMIC_SEP_LIST_12(ITEM)
#define _SEMIC_SEP_LIST_11(ITEM)
#define _SEMIC_SEP_LIST_10(ITEM)
#define _SEMIC_SEP_LIST_9(ITEM)
#define _SEMIC_SEP_LIST_8(ITEM)
#define _SEMIC_SEP_LIST_7(ITEM)
#define _SEMIC_SEP_LIST_6(ITEM)
#define _SEMIC_SEP_LIST_5(ITEM)
#define _SEMIC_SEP_LIST_4(ITEM)
#define _SEMIC_SEP_LIST_3(ITEM)
#define _SEMIC_SEP_LIST_2(ITEM)
#define _SEMIC_SEP_LIST_1(ITEM)
#define _SEMIC_SEP_LIST_0(ITEM)

// 1-based space separated list of ITEMs
#define SPACE_SEP_LIST(ITEM, LENGTH)
#define _SPACE_SEP_LIST_15(ITEM)
#define _SPACE_SEP_LIST_14(ITEM)
#define _SPACE_SEP_LIST_13(ITEM)
#define _SPACE_SEP_LIST_12(ITEM)
#define _SPACE_SEP_LIST_11(ITEM)
#define _SPACE_SEP_LIST_10(ITEM)
#define _SPACE_SEP_LIST_9(ITEM)
#define _SPACE_SEP_LIST_8(ITEM)
#define _SPACE_SEP_LIST_7(ITEM)
#define _SPACE_SEP_LIST_6(ITEM)
#define _SPACE_SEP_LIST_5(ITEM)
#define _SPACE_SEP_LIST_4(ITEM)
#define _SPACE_SEP_LIST_3(ITEM)
#define _SPACE_SEP_LIST_2(ITEM)
#define _SPACE_SEP_LIST_1(ITEM)
#define _SPACE_SEP_LIST_0(ITEM)

#define ARG
#define PARAM
#define TYPE_PARAM
#define PARAM_DECL

#define DECL_CMD

#define DECL_CMD_RET

#define DECL_CMD_SYNC

#define TYPE_ARG
#define CMD_TYPE
#define CMD_ASSIGN_PARAM

#define DECL_PUSH

#define CMD_RET_TYPE

#define DECL_PUSH_AND_RET

#define CMD_SYNC_TYPE

#define DECL_PUSH_AND_SYNC(N)

#define MAX_CMD_PARAMS

class CommandQueueMT {};

#undef ARG
#undef PARAM
#undef TYPE_PARAM
#undef PARAM_DECL
#undef DECL_CMD
#undef DECL_CMD_RET
#undef DECL_CMD_SYNC
#undef TYPE_ARG
#undef CMD_TYPE
#undef CMD_ASSIGN_PARAM
#undef DECL_PUSH
#undef CMD_RET_TYPE
#undef DECL_PUSH_AND_RET
#undef CMD_SYNC_TYPE
#undef DECL_CMD_SYNC

#endif // COMMAND_QUEUE_MT_H