Pol  Revision:cb584c9
userfunc.cpp
Go to the documentation of this file.
1 
7 #include "userfunc.h"
8 
9 #include <stddef.h>
10 
11 #include <format/format.h>
12 #include "../clib/logfacility.h"
13 
14 namespace Pol
15 {
16 namespace Bscript
17 {
18 unsigned int UserFunction::_instances;
19 std::set<UserFunction*> UserFunction::_instancelist;
21 {
22  fmt::Writer tmp;
23  for ( const auto& uf : _instancelist )
24  {
25  tmp << uf->name << "\n";
26  }
27  ERROR_PRINT << tmp.str();
28 }
30 {
31  ++_instances;
32  _instancelist.insert( this );
33 }
35 {
36  _instancelist.erase( this );
37  --_instances;
38 }
40 {
41  return _instances;
42 }
44  : name( "" ),
45  parameters(),
46  position( 0 ),
48  ctx(),
49  function_body( NULL ),
50  exported( false ),
51  emitted( false )
52 {
53 }
54 
55 UserFunction::~UserFunction() = default;
56 }
57 }
static void show_instances()
Definition: userfunc.cpp:20
static std::set< UserFunction * > _instancelist
Definition: userfunc.h:58
CompilerContext ctx
Definition: userfunc.h:46
static unsigned int _instances
Definition: userfunc.h:57
#define ERROR_PRINT
Definition: logfacility.h:230
static unsigned int instances()
Definition: userfunc.cpp:39
Definition: berror.cpp:12