polserver/pol-core/bscript/userfunc.cpp
turleypol d848deae18
POLLOG* macros use the new formatting (#598)
* POLLOG* macros use the new formatting
removed all old logging functions

* removed old fmt lib from everything except StreamWriter
removed unneeded functions

* fixed review comments
2024-01-16 17:55:42 +01:00

56 lines
902 B
C++

/** @file
*
* @par History
*/
#include "userfunc.h"
#include <stddef.h>
#include "../clib/logfacility.h"
namespace Pol
{
namespace Bscript
{
unsigned int UserFunction::_instances;
std::set<UserFunction*> UserFunction::_instancelist;
void UserFunction::show_instances()
{
std::string tmp;
for ( const auto& uf : _instancelist )
{
tmp += uf->name + "\n";
}
ERROR_PRINT( tmp );
}
void UserFunction::register_instance()
{
++_instances;
_instancelist.insert( this );
}
void UserFunction::unregister_instance()
{
_instancelist.erase( this );
--_instances;
}
unsigned int UserFunction::instances()
{
return _instances;
}
UserFunction::UserFunction()
: name( "" ),
parameters(),
position( 0 ),
forward_callers(),
ctx(),
function_body( nullptr ),
exported( false ),
emitted( false )
{
}
} // namespace Bscript
} // namespace Pol