core/ForwardSys.cpp
author Nicholas Hastings <skamonkey@gmail.com>
Wed Aug 14 14:20:57 2013 -0400 (2013-08-14)
changeset 4008 490b01aa0683
parent 3995 e94dfd569130
child 4086 63763f2a5c6c
permissions -rw-r--r--
Updated some CS:GO gamedata.
     1 /**
     2  * vim: set ts=4 sw=4 tw=99 noet :
     3  * =============================================================================
     4  * SourceMod
     5  * Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
     6  * =============================================================================
     7  *
     8  * This program is free software; you can redistribute it and/or modify it under
     9  * the terms of the GNU General Public License, version 3.0, as published by the
    10  * Free Software Foundation.
    11  * 
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program.  If not, see <http://www.gnu.org/licenses/>.
    19  *
    20  * As a special exception, AlliedModders LLC gives you permission to link the
    21  * code of this program (as well as its derivative works) to "Half-Life 2," the
    22  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    23  * by the Valve Corporation.  You must obey the GNU General Public License in
    24  * all respects for all other code used.  Additionally, AlliedModders LLC grants
    25  * this exception to all derivative works.  AlliedModders LLC defines further
    26  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    27  * or <http://www.sourcemod.net/license.php>.
    28  *
    29  * Version: $Id$
    30  */
    31 
    32 #include <assert.h>
    33 #include <stdarg.h>
    34 #include <string.h>
    35 #include "ForwardSys.h"
    36 #include "logic_bridge.h"
    37 
    38 CForwardManager g_Forwards;
    39 
    40 /**
    41  * Genesis turns to its source, reduction occurs stepwise although the essence is all one.
    42  * End of line.  FTL system check.
    43  *
    44  * :TODO: WHAT NEEDS TO BE TESTED IN THIS BEAST
    45  * VARARG FUNCTIONS:
    46  * - Pushing no varargs
    47  */
    48 
    49 // :TODO: IMPORTANT!!! The result pointer arg in the execute function maybe invalid if the forward fails
    50 // so later evaluation of this result may cause problems on higher levels of abstraction. DOCUMENT OR FIX ALL FORWARDS!
    51 
    52 CForwardManager::~CForwardManager()
    53 {
    54 	CStack<CForward *>::iterator iter;
    55 	for (iter=m_FreeForwards.begin(); iter!=m_FreeForwards.end(); iter++)
    56 	{
    57 		delete (*iter);
    58 	}
    59 	m_FreeForwards.popall();
    60 }
    61 
    62 void CForwardManager::OnSourceModAllInitialized()
    63 {
    64 	scripts->AddPluginsListener(this);
    65 	sharesys->AddInterface(NULL, this);
    66 }
    67 
    68 IForward *CForwardManager::CreateForward(const char *name, ExecType et, unsigned int num_params, const ParamType *types, ...)
    69 {
    70 	CForward *fwd;
    71 	va_list ap;
    72 	va_start(ap, types);
    73 	
    74 	fwd = CForward::CreateForward(name, et, num_params, types, ap);
    75 
    76 	va_end(ap);
    77 
    78 	if (fwd)
    79 	{
    80 		scripts->AddFunctionsToForward(name, fwd);
    81 
    82 		m_managed.push_back(fwd);
    83 	}
    84 
    85 	return fwd;
    86 }
    87 
    88 IChangeableForward *CForwardManager::CreateForwardEx(const char *name, ExecType et, int num_params, const ParamType *types, ...)
    89 {
    90 	CForward *fwd;
    91 	va_list ap;
    92 	va_start(ap, types);
    93 
    94 	fwd = CForward::CreateForward(name, et, num_params, types, ap);
    95 
    96 	va_end(ap);
    97 
    98 	if (fwd)
    99 	{
   100 		m_unmanaged.push_back(fwd);
   101 	}
   102 
   103 	return fwd;
   104 }
   105 
   106 void CForwardManager::OnPluginLoaded(IPlugin *plugin)
   107 {
   108 	/* Attach any globally managed forwards */
   109 	List<CForward *>::iterator iter;
   110 	CForward *fwd;
   111 
   112 	for (iter=m_managed.begin(); iter!=m_managed.end(); iter++)
   113 	{
   114 		fwd = (*iter);
   115 		IPluginFunction *pFunc = plugin->GetBaseContext()->GetFunctionByName(fwd->GetForwardName());
   116 		if (pFunc)
   117 		{
   118 			fwd->AddFunction(pFunc);
   119 		}
   120 	}
   121 }
   122 
   123 void CForwardManager::OnPluginUnloaded(IPlugin *plugin)
   124 {
   125 	List<CForward *>::iterator iter;
   126 	CForward *fwd;
   127 
   128 	for (iter=m_managed.begin(); iter!=m_managed.end(); iter++)
   129 	{
   130 		fwd = (*iter);
   131 		fwd->RemoveFunctionsOfPlugin(plugin);
   132 	}
   133 
   134 	for (iter=m_unmanaged.begin(); iter!=m_unmanaged.end(); iter++)
   135 	{
   136 		fwd = (*iter);
   137 		fwd->RemoveFunctionsOfPlugin(plugin);
   138 	}
   139 }
   140 
   141 IForward *CForwardManager::FindForward(const char *name, IChangeableForward **ifchng)
   142 {
   143 	List<CForward *>::iterator iter;
   144 	CForward *fwd;
   145 
   146 	for (iter=m_managed.begin(); iter!=m_managed.end(); iter++)
   147 	{
   148 		fwd = (*iter);
   149 		if (strcmp(fwd->GetForwardName(), name) == 0)
   150 		{
   151 			if (ifchng)
   152 			{
   153 				*ifchng = NULL;
   154 			}
   155 			return fwd;
   156 		}
   157 	}
   158 
   159 	for (iter=m_unmanaged.begin(); iter!=m_unmanaged.end(); iter++)
   160 	{
   161 		fwd = (*iter);
   162 		if (strcmp(fwd->GetForwardName(), name) == 0)
   163 		{
   164 			if (ifchng)
   165 			{
   166 				*ifchng = fwd;
   167 			}
   168 			return fwd;
   169 		}
   170 	}
   171 
   172 	if (ifchng)
   173 	{
   174 		*ifchng = NULL;
   175 	}
   176 
   177 	return NULL;
   178 }
   179 
   180 void CForwardManager::ReleaseForward(IForward *forward)
   181 {
   182 	ForwardFree(static_cast<CForward *>(forward));
   183 }
   184 
   185 void CForwardManager::ForwardFree(CForward *fwd)
   186 {
   187     if (fwd == NULL)
   188     {
   189         return;
   190     }
   191 
   192 	m_FreeForwards.push(fwd);
   193 	m_managed.remove(fwd);
   194 }
   195 
   196 CForward *CForwardManager::ForwardMake()
   197 {
   198 	CForward *fwd;
   199 	if (m_FreeForwards.empty())
   200 	{
   201 		fwd = new CForward;
   202 	} else {
   203 		fwd = m_FreeForwards.front();
   204 		m_FreeForwards.pop();
   205 	}
   206 	return fwd;
   207 }
   208 
   209 void CForwardManager::OnPluginPauseChange(IPlugin *plugin, bool paused)
   210 {
   211 	/* No longer used */
   212 }
   213 
   214 /*************************************
   215  * ACTUAL FORWARD API IMPLEMENTATION *
   216  *************************************/
   217 
   218 CForward *CForward::CreateForward(const char *name, ExecType et, unsigned int num_params, const ParamType *types, va_list ap)
   219 {
   220 	ParamType _types[SP_MAX_EXEC_PARAMS];
   221 
   222 	if (num_params > SP_MAX_EXEC_PARAMS)
   223 	{
   224 		return NULL;
   225 	}
   226 	
   227 	if (types == NULL && num_params)
   228 	{
   229 		for (unsigned int i=0; i<num_params; i++)
   230 		{
   231 			_types[i] = (ParamType)va_arg(ap, int);
   232 			if (_types[i] == Param_VarArgs && (i != num_params - 1))
   233 			{
   234 				return NULL;
   235 			}
   236 		}
   237 		types = _types;
   238 	} else {
   239 		for (unsigned int i=0; i<num_params; i++)
   240 		{
   241 			_types[i] = types[i];
   242 			if (types[i] == Param_VarArgs && (i != num_params - 1))
   243 			{
   244 				return NULL;
   245 			}
   246 		}
   247 	}
   248 
   249 	/* First parameter can never be varargs */
   250 	if (num_params && _types[0] == Param_VarArgs)
   251 	{
   252 		return NULL;
   253 	}
   254 
   255 	CForward *pForward = g_Forwards.ForwardMake();
   256 	pForward->m_IterGuard = NULL;
   257 	pForward->m_curparam = 0;
   258 	pForward->m_ExecType = et;
   259 	snprintf(pForward->m_name, FORWARDS_NAME_MAX, "%s", name ? name : "");
   260 	
   261 	for (unsigned int i=0; i<num_params; i++)
   262 	{
   263 		pForward->m_types[i] = _types[i];
   264 	}
   265 
   266 	if (num_params && _types[num_params-1] == Param_VarArgs)
   267 	{
   268 		pForward->m_varargs = num_params--;
   269 	} else {
   270 		pForward->m_varargs = false;
   271 	}
   272 
   273 	pForward->m_numparams = num_params;
   274 	pForward->m_errstate = SP_ERROR_NONE;
   275 
   276 	pForward->m_functions.clear();
   277 
   278 	return pForward;
   279 }
   280 
   281 int CForward::Execute(cell_t *result, IForwardFilter *filter)
   282 {
   283 	if (m_errstate)
   284 	{
   285 		int err = m_errstate;
   286 		Cancel();
   287 		return err;
   288 	}
   289 
   290 	FuncIter iter = m_functions.begin();
   291 	IPluginFunction *func;
   292 	cell_t cur_result = 0;
   293 	cell_t high_result = 0;
   294 	cell_t low_result = 0;
   295 	int err;
   296 	unsigned int success=0;
   297 	unsigned int num_params = m_curparam;
   298 	FwdParamInfo temp_info[SP_MAX_EXEC_PARAMS];
   299 	FwdParamInfo *param;
   300 	ParamType type;
   301 
   302 	/* Save local, reset */
   303 	memcpy(temp_info, m_params, sizeof(m_params));
   304 	m_curparam = 0;
   305 
   306 	FuncIteratorGuard guard(&m_IterGuard, &iter);
   307 
   308 	while (iter != m_functions.end())
   309 	{
   310 		func = (*iter);
   311 
   312 		if (filter)
   313 			filter->Preprocess(func, temp_info);
   314 
   315 		for (unsigned int i=0; i<num_params; i++)
   316 		{
   317 			int err = SP_ERROR_PARAM;
   318 			param = &temp_info[i];
   319 
   320 			if (i >= m_numparams || m_types[i] == Param_Any)
   321 			{
   322 				type = param->pushedas;
   323 			}
   324 			else
   325 			{
   326 				type = m_types[i];
   327 			}
   328 
   329 			if ((i >= m_numparams) || (type & SP_PARAMFLAG_BYREF))
   330 			{
   331 				/* If we're byref or we're vararg, we always push everything by ref.
   332 				 * Even if they're byval, we must push them byref.
   333 				 */
   334 				if (type == Param_String)
   335 				{
   336 					err = func->PushStringEx((char *)param->byref.orig_addr, param->byref.cells, param->byref.sz_flags, param->byref.flags);
   337 				}
   338 				else if (type == Param_Float || type == Param_Cell)
   339 				{
   340 					err = func->PushCellByRef(&param->val); 
   341 				}
   342 				else
   343 				{
   344 					err = func->PushArray(param->byref.orig_addr, param->byref.cells, param->byref.flags);
   345 					assert(type == Param_Array || type == Param_FloatByRef || type == Param_CellByRef);
   346 				}
   347 			}
   348 			else
   349 			{
   350 				/* If we're not byref or not vararg, our job is a bit easier. */
   351 				assert(type == Param_Cell || type == Param_Float);
   352 				err = func->PushCell(param->val);
   353 			}
   354 
   355 			if (err != SP_ERROR_NONE)
   356 			{
   357 				logicore.GenerateError(func->GetParentContext(), 
   358 					func->GetFunctionID(), 
   359 					err, 
   360 					"Failed to push parameter while executing forward");
   361 				continue;
   362 			}
   363 		}
   364 		
   365 		/* Call the function and deal with the return value. */
   366 		if ((err=func->Execute(&cur_result)) == SP_ERROR_NONE)
   367 		{
   368 			success++;
   369 			switch (m_ExecType)
   370 			{
   371 			case ET_Event:
   372 				{
   373 					if (cur_result > high_result)
   374 					{
   375 						high_result = cur_result;
   376 					}
   377 					break;
   378 				}
   379 			case ET_Hook:
   380 				{
   381 					if (cur_result > high_result)
   382 					{
   383 						high_result = cur_result;
   384 						if ((ResultType)high_result == Pl_Stop)
   385 						{
   386 							goto done;
   387 						}
   388 					}
   389 					break;
   390 				}
   391 			case ET_LowEvent:
   392 				{
   393 					/* Check if the current result is the lowest so far (or if it's the first result) */
   394 					if (cur_result < low_result || success == 1)
   395 					{
   396 						low_result = cur_result;
   397 					}
   398 					break;
   399 				}
   400 			default:
   401 				{
   402 					break;
   403 				}
   404 			}
   405 		}
   406 
   407 		if (!guard.Triggered())
   408 			iter++;
   409 	}
   410 
   411 done:
   412 
   413 	if (success)
   414 	{
   415 		switch (m_ExecType)
   416 		{
   417 		case ET_Ignore:
   418 			{
   419 				cur_result = 0;
   420 				break;
   421 			}
   422 		case ET_Event:
   423 		case ET_Hook:
   424 			{
   425 				cur_result = high_result;
   426 				break;
   427 			}
   428 		case ET_LowEvent:
   429 			{
   430 				cur_result = low_result;
   431 				break;
   432 			}
   433 		default:
   434 			{
   435 				break;
   436 			}
   437 		}
   438 
   439 		if (result)
   440 		{
   441 			*result = cur_result;
   442 		}
   443 	}
   444 
   445 	return SP_ERROR_NONE;
   446 }
   447 
   448 int CForward::PushCell(cell_t cell)
   449 {
   450 	if (m_curparam < m_numparams)
   451 	{
   452 		if (m_types[m_curparam] == Param_Any)
   453 		{
   454 			m_params[m_curparam].pushedas = Param_Cell;
   455 		} else if (m_types[m_curparam] != Param_Cell) {
   456 			return SetError(SP_ERROR_PARAM);
   457 		}
   458 	} else {
   459 		if (!m_varargs || m_numparams > SP_MAX_EXEC_PARAMS)
   460 		{
   461 			return SetError(SP_ERROR_PARAMS_MAX);
   462 		}
   463 		m_params[m_curparam].pushedas = Param_Cell;
   464 	}
   465 
   466 	m_params[m_curparam++].val = cell;
   467 
   468 	return SP_ERROR_NONE;
   469 }
   470 
   471 int CForward::PushFloat(float number)
   472 {
   473 	if (m_curparam < m_numparams)
   474 	{
   475 		if (m_types[m_curparam] == Param_Any)
   476 		{
   477 			m_params[m_curparam].pushedas = Param_Float;
   478 		} else if (m_types[m_curparam] != Param_Float) {
   479 			return SetError(SP_ERROR_PARAM);
   480 		}
   481 	} else {
   482 		if (!m_varargs || m_numparams > SP_MAX_EXEC_PARAMS)
   483 		{
   484 			return SetError(SP_ERROR_PARAMS_MAX);
   485 		}
   486 		m_params[m_curparam].pushedas = Param_Float;
   487 	}
   488 
   489 	m_params[m_curparam++].val = *(cell_t *)&number;
   490 
   491 	return SP_ERROR_NONE;
   492 }
   493 
   494 int CForward::PushCellByRef(cell_t *cell, int flags)
   495 {
   496 	if (m_curparam < m_numparams)
   497 	{
   498 		if (m_types[m_curparam] == Param_Any)
   499 		{
   500 			m_params[m_curparam].pushedas = Param_CellByRef;
   501 		} else if (m_types[m_curparam] != Param_CellByRef) {
   502 			return SetError(SP_ERROR_PARAM);
   503 		}
   504 	} else {
   505 		if (!m_varargs || m_numparams > SP_MAX_EXEC_PARAMS)
   506 		{
   507 			return SetError(SP_ERROR_PARAMS_MAX);
   508 		}
   509 		m_params[m_curparam].pushedas = Param_CellByRef;
   510 	}
   511 
   512 	_Int_PushArray(cell, 1, flags);
   513 	m_curparam++;
   514 
   515 	return SP_ERROR_NONE;
   516 }
   517 
   518 int CForward::PushFloatByRef(float *num, int flags)
   519 {
   520 	if (m_curparam < m_numparams)
   521 	{
   522 		if (m_types[m_curparam] == Param_Any)
   523 		{
   524 			m_params[m_curparam].pushedas = Param_FloatByRef;
   525 		} else if (m_types[m_curparam] != Param_FloatByRef) {
   526 			return SetError(SP_ERROR_PARAM);
   527 		}
   528 	} else {
   529 		if (!m_varargs || m_numparams > SP_MAX_EXEC_PARAMS)
   530 		{
   531 			return SetError(SP_ERROR_PARAMS_MAX);
   532 		}
   533 		m_params[m_curparam].pushedas = Param_FloatByRef;
   534 	}
   535 
   536 	_Int_PushArray((cell_t *)num, 1, flags);
   537 	m_curparam++;
   538 
   539 	return SP_ERROR_NONE;
   540 }
   541 
   542 void CForward::_Int_PushArray(cell_t *inarray, unsigned int cells, int flags)
   543 {
   544 	m_params[m_curparam].byref.cells = cells;
   545 	m_params[m_curparam].byref.flags = flags;
   546 	m_params[m_curparam].byref.orig_addr = inarray;
   547 }
   548 
   549 int CForward::PushArray(cell_t *inarray, unsigned int cells, int flags)
   550 {
   551 	/* We don't allow this here */
   552 	if (!inarray)
   553 	{
   554 		return SetError(SP_ERROR_PARAM);
   555 	}
   556 
   557 	if (m_curparam < m_numparams)
   558 	{
   559 		if (m_types[m_curparam] == Param_Any)
   560 		{
   561 			m_params[m_curparam].pushedas = Param_Array;
   562 		} else if (m_types[m_curparam] != Param_Array) {
   563 			return SetError(SP_ERROR_PARAM);
   564 		}
   565 	} else {
   566 		if (!m_varargs || m_curparam > SP_MAX_EXEC_PARAMS)
   567 		{
   568 			return SetError(SP_ERROR_PARAMS_MAX);
   569 		}
   570 		m_params[m_curparam].pushedas = Param_Array;
   571 	}
   572 
   573 	_Int_PushArray(inarray, cells, flags);
   574 
   575 	m_curparam++;
   576 
   577 	return SP_ERROR_NONE;
   578 }
   579 
   580 void CForward::_Int_PushString(cell_t *inarray, unsigned int cells, int sz_flags, int cp_flags)
   581 {
   582 	m_params[m_curparam].byref.cells = cells;	/* Notice this contains the char count not cell count */
   583 	m_params[m_curparam].byref.flags = cp_flags;
   584 	m_params[m_curparam].byref.orig_addr = inarray;
   585 	m_params[m_curparam].byref.sz_flags = sz_flags;
   586 }
   587 
   588 int CForward::PushString(const char *string)
   589 {
   590 	if (m_curparam < m_numparams)
   591 	{
   592 		if (m_types[m_curparam] == Param_Any)
   593 		{
   594 			m_params[m_curparam].pushedas = Param_String;
   595 		} else if (m_types[m_curparam] != Param_String) {
   596 			return SetError(SP_ERROR_PARAM);
   597 		}
   598 	} else {
   599 		if (!m_varargs || m_curparam > SP_MAX_EXEC_PARAMS)
   600 		{
   601 			return SetError(SP_ERROR_PARAMS_MAX);
   602 		}
   603 		m_params[m_curparam].pushedas = Param_String;
   604 	}
   605 
   606 	_Int_PushString((cell_t *)string, strlen(string)+1, SM_PARAM_STRING_COPY, 0);
   607 	m_curparam++;
   608 
   609 	return SP_ERROR_NONE;
   610 }
   611 
   612 int CForward::PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags)
   613 {
   614 	if (m_curparam < m_numparams)
   615 	{
   616 		if (m_types[m_curparam] == Param_Any)
   617 		{
   618 			m_params[m_curparam].pushedas = Param_String;
   619 		} else if (m_types[m_curparam] != Param_String) {
   620 			return SetError(SP_ERROR_PARAM);
   621 		}
   622 	} else {
   623 		if (!m_varargs || m_curparam > SP_MAX_EXEC_PARAMS)
   624 		{
   625 			return SetError(SP_ERROR_PARAMS_MAX);
   626 		}
   627 		m_params[m_curparam].pushedas = Param_String;
   628 	}
   629 
   630 	_Int_PushString((cell_t *)buffer, length, sz_flags, cp_flags);
   631 	m_curparam++;
   632 
   633 	return SP_ERROR_NONE;
   634 }
   635 
   636 void CForward::Cancel()
   637 {
   638 	if (!m_curparam)
   639 	{
   640 		return;
   641 	}
   642 
   643 	m_curparam = 0;
   644 	m_errstate = SP_ERROR_NONE;
   645 }
   646 
   647 bool CForward::AddFunction(IPluginContext *pContext, funcid_t index)
   648 {
   649 	IPluginFunction *pFunc = pContext->GetFunctionById(index);
   650 
   651 	if (!pFunc)
   652 	{
   653 		return false;
   654 	}
   655 
   656 	return AddFunction(pFunc);
   657 }
   658 
   659 bool CForward::RemoveFunction(IPluginContext *pContext, funcid_t index)
   660 {
   661 	IPluginFunction *pFunc = pContext->GetFunctionById(index);
   662 
   663 	if (!pFunc)
   664 	{
   665 		return false;
   666 	}
   667 
   668 	return RemoveFunction(pFunc);
   669 }
   670 
   671 bool CForward::RemoveFunction(IPluginFunction *func)
   672 {
   673 	bool found = false;
   674 	FuncIter iter;
   675 	List<IPluginFunction *> *lst;
   676 
   677 	if (func->IsRunnable())
   678 	{
   679 		lst = &m_functions;
   680 	} else {
   681 		lst = &m_paused;
   682 	}
   683 
   684 	for (iter=lst->begin(); iter!=lst->end(); iter++)
   685 	{
   686 		if ((*iter) == func)
   687 		{
   688 			m_IterGuard->FixIteratorChain(iter);
   689 			found = true;
   690 			lst->erase(iter);
   691 			break;
   692 		}
   693 	}
   694 
   695 	/* Cancel a call, if any */
   696 	if (found || m_curparam)
   697 	{
   698 		func->Cancel();
   699 	}
   700 
   701 	return found;
   702 }
   703 
   704 unsigned int CForward::RemoveFunctionsOfPlugin(IPlugin *plugin)
   705 {
   706 	FuncIter iter;
   707 	IPluginFunction *func;
   708 	unsigned int removed = 0;
   709 	IPluginContext *pContext = plugin->GetBaseContext();
   710 	for (iter=m_functions.begin(); iter!=m_functions.end();)
   711 	{
   712 		func = (*iter);
   713 		if (func->GetParentContext() == pContext)
   714 		{
   715 			iter = m_functions.erase(iter);
   716 			removed++;
   717 		} else {
   718 			iter++;
   719 		}
   720 	}
   721 
   722 	return removed;
   723 }
   724 
   725 bool CForward::AddFunction(IPluginFunction *func)
   726 {
   727 	if (m_curparam)
   728 	{
   729 		return false;
   730 	}
   731 
   732 	if (func->IsRunnable())
   733 	{
   734 		m_functions.push_back(func);
   735 	} else {
   736 		m_paused.push_back(func);
   737 	}
   738 
   739 	return true;
   740 }
   741 
   742 const char *CForward::GetForwardName()
   743 {
   744 	return m_name;
   745 }
   746 
   747 unsigned int CForward::GetFunctionCount()
   748 {
   749 	return m_functions.size();
   750 }
   751 
   752 ExecType CForward::GetExecType()
   753 {
   754 	return m_ExecType;
   755 }