Torque3D Documentation / _generateds / moduleDefinition_ScriptBinding.h

moduleDefinition_ScriptBinding.h

Engine/source/module/moduleDefinition_ScriptBinding.h

More...

Public Functions

DefineEngineMethod(ModuleDefinition , addDependency , bool , (const char *pModuleId, U32 versionId) , ("", 0) , "Adds the specified moduleId and vesionId as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@param moduleId The module Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@param versionId The version Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> dependency. Using zero indicates any version." "@return (bool <a href="/coding/file/codeinterpreter_8h/#codeinterpreter_8h_1a6b4b0e49305f04dba3d0b888008d675fab8916948582bbb4902d6ad269064f7ef">success</a>) Whether the module dependency was added or not." )
DefineEngineMethod(ModuleDefinition , getDependency , String , (U32 dependencyIndex) , (0) , "Gets the module dependency at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n</a>" "@param dependencyIndex The module dependency <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n</a>" "@return (module - dependency) The module dependency at the specified index." )
DefineEngineMethod(ModuleDefinition , getDependencyCount , S32 , () , "Gets the number of module dependencies this module definition <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">has.\n</a>" "@return (int <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>) The number of module dependencies this module definition <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">has.\n</a>" )
DefineEngineMethod(ModuleDefinition , getModuleManager , S32 , () , "Gets the module manager which this module definition is registered with (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return (moduleManager) The module manager which this module definition is registered with (zero <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> not registered).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ModuleDefinition , removeDependency , bool , (const char *pModuleId) , ("") , "Removes the specified moduleId as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@param moduleId The module Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@return (bool <a href="/coding/file/codeinterpreter_8h/#codeinterpreter_8h_1a6b4b0e49305f04dba3d0b888008d675fab8916948582bbb4902d6ad269064f7ef">success</a>) Whether the module dependency was removed or not." )
DefineEngineMethod(ModuleDefinition , save , bool , () , "Saves the module definition <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> it was loaded from (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return (bool <a href="/coding/file/codeinterpreter_8h/#codeinterpreter_8h_1a6b4b0e49305f04dba3d0b888008d675fab8916948582bbb4902d6ad269064f7ef">success</a>) Whether the module definition was saved or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" )

Detailed Description

Public Functions

DefineEngineMethod(ModuleDefinition , addDependency , bool , (const char *pModuleId, U32 versionId) , ("", 0) , "Adds the specified moduleId and vesionId as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@param moduleId The module Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@param versionId The version Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> dependency. Using zero indicates any version." "@return (bool <a href="/coding/file/codeinterpreter_8h/#codeinterpreter_8h_1a6b4b0e49305f04dba3d0b888008d675fab8916948582bbb4902d6ad269064f7ef">success</a>) Whether the module dependency was added or not." )

DefineEngineMethod(ModuleDefinition , getDependency , String , (U32 dependencyIndex) , (0) , "Gets the module dependency at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n</a>" "@param dependencyIndex The module dependency <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n</a>" "@return (module - dependency) The module dependency at the specified index." )

DefineEngineMethod(ModuleDefinition , getDependencyCount , S32 , () , "Gets the number of module dependencies this module definition <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">has.\n</a>" "@return (int <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>) The number of module dependencies this module definition <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">has.\n</a>" )

DefineEngineMethod(ModuleDefinition , getModuleManager , S32 , () , "Gets the module manager which this module definition is registered with (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return (moduleManager) The module manager which this module definition is registered with (zero <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> not registered).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )

DefineEngineMethod(ModuleDefinition , removeDependency , bool , (const char *pModuleId) , ("") , "Removes the specified moduleId as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@param moduleId The module Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">dependency.\n</a>" "@return (bool <a href="/coding/file/codeinterpreter_8h/#codeinterpreter_8h_1a6b4b0e49305f04dba3d0b888008d675fab8916948582bbb4902d6ad269064f7ef">success</a>) Whether the module dependency was removed or not." )

DefineEngineMethod(ModuleDefinition , save , bool , () , "Saves the module definition <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> it was loaded from (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return (bool <a href="/coding/file/codeinterpreter_8h/#codeinterpreter_8h_1a6b4b0e49305f04dba3d0b888008d675fab8916948582bbb4902d6ad269064f7ef">success</a>) Whether the module definition was saved or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" )

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2013 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23#include "console/engineAPI.h"
24#include "moduleDefinition.h"
25#include "moduleManager.h"
26
27DefineEngineMethod(ModuleDefinition, save, bool, (),,
28   "Saves the module definition to the file it was loaded from (if any).\n"
29   "@return (bool success) Whether the module definition was saved or not.\n")
30{
31    // Save.
32    return object->save();
33}
34
35//-----------------------------------------------------------------------------
36
37DefineEngineMethod(ModuleDefinition, getModuleManager, S32, (),,
38   "Gets the module manager which this module definition is registered with (if any).\n"
39   "@return (moduleManager) The module manager which this module definition is registered with (zero if not registered).\n")
40{
41    // Fetch module manager.
42    ModuleManager* pModuleManager = object->getModuleManager();
43
44    return pModuleManager != NULL ? pModuleManager->getId() : 0;
45}
46
47//-----------------------------------------------------------------------------
48
49DefineEngineMethod(ModuleDefinition, getDependencyCount, S32, (), ,
50   "Gets the number of module dependencies this module definition has.\n"
51   "@return (int count) The number of module dependencies this module definition has.\n")
52{
53    // Get module dependency count.
54    return object->getDependencyCount();
55}
56
57//-----------------------------------------------------------------------------
58
59DefineEngineMethod(ModuleDefinition, getDependency, String, (U32 dependencyIndex), (0), 
60   "Gets the module dependency at the specified index.\n"
61   "@param dependencyIndex The module dependency index.\n"
62   "@return (module - dependency) The module dependency at the specified index.")
63{
64    // Get module dependency.
65    ModuleDefinition::ModuleDependency dependency;
66    if ( object->getDependency( dependencyIndex, dependency ) == false )
67        return StringTable->EmptyString();
68
69    // Format module dependency.
70    char* pReturnBuffer = Con::getReturnBuffer( 256 );
71    dSprintf( pReturnBuffer, 256, "%s %d", dependency.mModuleId, dependency.mVersionId );
72
73    return pReturnBuffer;
74}
75
76//-----------------------------------------------------------------------------
77
78DefineEngineMethod(ModuleDefinition, addDependency, bool, (const char* pModuleId, U32 versionId), ("", 0),
79   "Adds the specified moduleId and vesionId as a dependency.\n"
80   "@param moduleId The module Id to add as a dependency.\n"
81   "@param versionId The version Id to add as a dependency.  Using zero indicates any version."
82   "@return (bool success) Whether the module dependency was added or not.")
83{
84    // Add dependency.
85    return object->addDependency( pModuleId, versionId );
86}
87
88//-----------------------------------------------------------------------------
89
90DefineEngineMethod(ModuleDefinition, removeDependency, bool, (const char* pModuleId), (""),
91   "Removes the specified moduleId as a dependency.\n"
92   "@param moduleId The module Id to remove as a dependency.\n"
93   "@return (bool success) Whether the module dependency was removed or not.")
94{
95    // Remove dependency.
96    return object->removeDependency( pModuleId );
97}
98