diff --git a/modules/irc/Module.cpp b/modules/irc/Module.cpp index 528f6618..355de567 100644 --- a/modules/irc/Module.cpp +++ b/modules/irc/Module.cpp @@ -35,13 +35,13 @@ static bool RegisterAPI() return false; } - Table ircns; + Table ircns(DefaultVM::Get()); Register_Common(ircns); Register_Session(ircns); Register_Constants(ircns); - RootTable().Bind(_SC("SqIRC"), ircns); + RootTable(DefaultVM::Get()).Bind(_SC("SqIRC"), ircns); // Registration was successful return true; diff --git a/modules/json/Module.cpp b/modules/json/Module.cpp index d65987a1..165b809e 100644 --- a/modules/json/Module.cpp +++ b/modules/json/Module.cpp @@ -27,16 +27,16 @@ static bool RegisterAPI() return false; } - Table jns; + Table jns(DefaultVM::Get()); Register_Common(jns); Register_JArray(jns); Register_JObject(jns); Register_JValue(jns); - RootTable().Bind(_SC("SqJSON"), jns); + RootTable(DefaultVM::Get()).Bind(_SC("SqJSON"), jns); - Sqrat::ConstTable() + Sqrat::ConstTable(DefaultVM::Get()) .Const(_SC("JSON_OBJECT"), JSON_OBJECT) .Const(_SC("JSON_ARRAY"), JSON_ARRAY) .Const(_SC("JSON_STRING"), JSON_STRING) diff --git a/modules/mg/Module.cpp b/modules/mg/Module.cpp index c83ee76a..e08ce6dc 100644 --- a/modules/mg/Module.cpp +++ b/modules/mg/Module.cpp @@ -23,9 +23,9 @@ static bool RegisterAPI() return false; } - Table mgns; + Table mgns(DefaultVM::Get()); - mgns.Bind(_SC("Manager"), Class< Manager >(mgns,GetVM(), _SC("SqMgManager")) + mgns.Bind(_SC("Manager"), Class< Manager >(DefaultVM::Get(), _SC("SqMgManager")) // Constructors .Ctor() .Ctor< const Manager & >() @@ -44,7 +44,7 @@ static bool RegisterAPI() .Overload< Connection (Manager::*)(CSStr, Uint32) const >(_SC("Connect"), &Manager::Connect) ); - mgns.Bind(_SC("Connection"), Class< Connection >(mgns,GetVM(), _SC("SqMgConnection")) + mgns.Bind(_SC("Connection"), Class< Connection >(DefaultVM::Get(), _SC("SqMgConnection")) // Constructors .Ctor() .Ctor< const Connection & >() @@ -58,9 +58,9 @@ static bool RegisterAPI() //.Func(_SC("Check"), &Connection::Check) ); - RootTable().Bind(_SC("SqMg"), mgns); + RootTable(DefaultVM::Get()).Bind(_SC("SqMg"), mgns); - ConstTable().Enum(_SC("EMgF"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("EMgF"), Enumeration(DefaultVM::Get()) .Const(_SC("LISTENING"), MG_F_LISTENING) .Const(_SC("UDP"), MG_F_UDP) .Const(_SC("RESOLVING"), MG_F_RESOLVING) @@ -81,7 +81,7 @@ static bool RegisterAPI() .Const(_SC("USER_6"), MG_F_USER_6) ); - ConstTable().Enum(_SC("MgEv"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("MgEv"), Enumeration(DefaultVM::Get()) .Const(_SC("UNKNOWN"), static_cast< Int32 >(MGEV_UNKNOWN)) .Const(_SC("POLL"), static_cast< Int32 >(MGCE_POLL)) .Const(_SC("ACCEPT"), static_cast< Int32 >(MGCE_ACCEPT)) diff --git a/modules/mysql/Module.cpp b/modules/mysql/Module.cpp index 681f80b0..66b2a57d 100644 --- a/modules/mysql/Module.cpp +++ b/modules/mysql/Module.cpp @@ -27,14 +27,14 @@ static bool RegisterAPI() return false; } - Table sqlns; + Table sqlns(DefaultVM::Get()); Register_Account(sqlns); Register_Connection(sqlns); Register_ResultSet(sqlns); Register_Statement(sqlns); - RootTable().Bind(_SC("SqMySQL"), sqlns); + RootTable(DefaultVM::Get()).Bind(_SC("SqMySQL"), sqlns); // Registration was successful return true; diff --git a/modules/sample/Module.cpp b/modules/sample/Module.cpp index 174cced4..d952c5d7 100644 --- a/modules/sample/Module.cpp +++ b/modules/sample/Module.cpp @@ -21,7 +21,8 @@ static bool RegisterAPI() return false; } - RootTable().Bind(_SC("SampleType"), Class< SampleType >(DefaultVM::Get(), _SC("SampleType")) + RootTable(DefaultVM::Get()).Bind(_SC("SampleType"), + Class< SampleType >(DefaultVM::Get(), _SC("SampleType")) .Ctor() .Ctor< int >() .Var(_SC("MyNum"), &SampleType::mMyNum) @@ -29,7 +30,7 @@ static bool RegisterAPI() .Func(_SC("SampleMethod"), &SampleType::SampleMethod) ); - RootTable().Func(_SC("SampleFunction"), &SampleFunction); + RootTable(DefaultVM::Get()).Func(_SC("SampleFunction"), &SampleFunction); // Registration was successful return true; diff --git a/modules/sqlite/Module.cpp b/modules/sqlite/Module.cpp index cb0be190..279750bc 100644 --- a/modules/sqlite/Module.cpp +++ b/modules/sqlite/Module.cpp @@ -30,7 +30,7 @@ static bool RegisterAPI() return false; } - Table sqlns; + Table sqlns(DefaultVM::Get()); Register_Constants(sqlns); Register_Common(sqlns); @@ -40,7 +40,7 @@ static bool RegisterAPI() Register_Column(sqlns); Register_Transaction(sqlns); - RootTable().Bind(_SC("SQLite"), sqlns); + RootTable(DefaultVM::Get()).Bind(_SC("SQLite"), sqlns); // Registration was successful return true; diff --git a/modules/xml/Module.cpp b/modules/xml/Module.cpp index 5186f412..715afa6c 100644 --- a/modules/xml/Module.cpp +++ b/modules/xml/Module.cpp @@ -26,9 +26,9 @@ static bool RegisterAPI() return false; } - Table xmlns; + Table xmlns(DefaultVM::Get()); - xmlns.Bind(_SC("ParseResult"), Class< ParseResult >(xmlns.GetVM(), _SC("SqXmlParseResult")) + xmlns.Bind(_SC("ParseResult"), Class< ParseResult >(DefaultVM::Get(), _SC("SqXmlParseResult")) // Constructors .Ctor() .Ctor< const ParseResult & >() @@ -48,7 +48,7 @@ static bool RegisterAPI() .Func(_SC("Check"), &ParseResult::Check) ); - xmlns.Bind(_SC("Attribute"), Class< Attribute >(xmlns.GetVM(), _SC("SqXmlAttribute")) + xmlns.Bind(_SC("Attribute"), Class< Attribute >(DefaultVM::Get(), _SC("SqXmlAttribute")) // Constructors .Ctor() .Ctor< const Attribute & >() @@ -93,7 +93,7 @@ static bool RegisterAPI() .Func(_SC("SetBool"), &Attribute::ApplyBool) ); - xmlns.Bind(_SC("Text"), Class< Text >(xmlns.GetVM(), _SC("SqXmlText")) + xmlns.Bind(_SC("Text"), Class< Text >(DefaultVM::Get(), _SC("SqXmlText")) // Constructors .Ctor() .Ctor< const Text & >() @@ -133,7 +133,7 @@ static bool RegisterAPI() .Func(_SC("SetBool"), &Text::ApplyBool) ); - xmlns.Bind(_SC("Node"), Class< Node >(xmlns.GetVM(), _SC("SqXmlNode")) + xmlns.Bind(_SC("Node"), Class< Node >(DefaultVM::Get(), _SC("SqXmlNode")) // Constructors .Ctor() .Ctor< const Node & >() @@ -209,7 +209,7 @@ static bool RegisterAPI() .Func(_SC("FindElemByPath"), &Node::FindElemByPath) ); - xmlns.Bind(_SC("Document"), Class< Document, NoCopy< Document > >(xmlns.GetVM(), _SC("SqXmlDocument")) + xmlns.Bind(_SC("Document"), Class< Document, NoCopy< Document > >(DefaultVM::Get(), _SC("SqXmlDocument")) // Constructors .Ctor() // Core Meta-methods @@ -234,9 +234,9 @@ static bool RegisterAPI() .Overload< void (Document::*)(CSStr, CSStr, Uint32, Int32) >(_SC("SaveFile"), &Document::SaveFile) ); - RootTable().Bind(_SC("SqXml"), xmlns); + RootTable(DefaultVM::Get()).Bind(_SC("SqXml"), xmlns); - ConstTable().Enum(_SC("SqXmlNodeType"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("SqXmlNodeType"), Enumeration(DefaultVM::Get()) .Const(_SC("Null"), static_cast< Int32 >(node_null)) .Const(_SC("Document"), static_cast< Int32 >(node_document)) .Const(_SC("Element"), static_cast< Int32 >(node_element)) @@ -248,7 +248,7 @@ static bool RegisterAPI() .Const(_SC("Doctype"), static_cast< Int32 >(node_doctype)) ); - ConstTable().Enum(_SC("SqXmlParse"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("SqXmlParse"), Enumeration(DefaultVM::Get()) .Const(_SC("Minimal"), static_cast< Int32 >(parse_minimal)) .Const(_SC("Default"), static_cast< Int32 >(parse_default)) .Const(_SC("Full"), static_cast< Int32 >(parse_full)) @@ -268,7 +268,7 @@ static bool RegisterAPI() .Const(_SC("EmbedPCData"), static_cast< Int32 >(parse_embed_pcdata)) ); - ConstTable().Enum(_SC("SqXmlEncoding"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("SqXmlEncoding"), Enumeration(DefaultVM::Get()) .Const(_SC("Auto"), static_cast< Int32 >(encoding_auto)) .Const(_SC("Utf8"), static_cast< Int32 >(encoding_utf8)) .Const(_SC("Utf16LE"), static_cast< Int32 >(encoding_utf16_le)) @@ -281,7 +281,7 @@ static bool RegisterAPI() .Const(_SC("Latin1"), static_cast< Int32 >(encoding_latin1)) ); - ConstTable().Enum(_SC("SqXmlFormat"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("SqXmlFormat"), Enumeration(DefaultVM::Get()) .Const(_SC("Indent"), static_cast< Int32 >(format_indent)) .Const(_SC("WriteBOM"), static_cast< Int32 >(format_write_bom)) .Const(_SC("Raw"), static_cast< Int32 >(format_raw)) @@ -292,7 +292,7 @@ static bool RegisterAPI() .Const(_SC("Default"), static_cast< Int32 >(format_default)) ); - ConstTable().Enum(_SC("SqXmlParseStatus"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("SqXmlParseStatus"), Enumeration(DefaultVM::Get()) .Const(_SC("Ok"), static_cast< Int32 >(status_ok)) .Const(_SC("FileNotFound"), static_cast< Int32 >(status_file_not_found)) .Const(_SC("IOError"), static_cast< Int32 >(status_io_error)) @@ -312,7 +312,7 @@ static bool RegisterAPI() .Const(_SC("NoDocumentElement"), static_cast< Int32 >(status_no_document_element)) ); - ConstTable().Enum(_SC("SqXmlXpathValueType"), Enumeration() + ConstTable(DefaultVM::Get()).Enum(_SC("SqXmlXpathValueType"), Enumeration(DefaultVM::Get()) .Const(_SC("None"), static_cast< Int32 >(xpath_type_none)) .Const(_SC("NodeSet"), static_cast< Int32 >(xpath_type_node_set)) .Const(_SC("Number"), static_cast< Int32 >(xpath_type_number))