FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NoahGameFrame/NFComm/NFPluginModule/NFIScriptModule.h at develop · ifivebig/NoahGameFrame · GitHub
ifivebig
/
NoahGameFrame
Public
forked from
ketoo/NoahGameFrame
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
NoahGameFrame
/
NFComm
/
NFPluginModule
/
NFIScriptModule.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
529 lines (436 loc) · 22.4 KB
Breadcrumbs
NoahGameFrame
/
NFComm
/
NFPluginModule
/
NFIScriptModule.h
Copy path
File metadata and controls
529 lines (436 loc) · 22.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
//
-------------------------------------------------------------------------
//
@FileName : NFIScriptModule.h
//
@Author : LvSheng.Huang
//
@Date : 2013-07-08
//
@Module : NFIScriptModule
//
@Desc : every script plugin need to export two interfaces(NFCScriptVarList and most of NFCScriptKernel)
//
-------------------------------------------------------------------------
#
ifndef
_NFI_SCRIPT_MODULE_H_
#
define
_NFI_SCRIPT_MODULE_H_
#
include
<
iostream
>
#
include
"
NFILogicModule.h
"
#
include
"
NFComm/NFCore/NFCDataList.h
"
#
include
"
NFComm/NFPluginModule/NFIdentID.h
"
#
include
"
NFComm/NFPluginModule/NFIElementInfoModule.h
"
#
include
"
NFComm/NFPluginModule/NFIKernelModule.h
"
#
include
"
NFComm/NFPluginModule/NFILogicClassModule.h
"
#
include
"
NFComm/NFPluginModule/NFIEventProcessModule.h
"
#
include
"
NFComm/NFPluginModule/NFILuaScriptModule.h
"
#
include
"
NFComm/NFPluginModule/NFIPluginManager.h
"
class
NFCScriptName
{
public:
bool
operator
< (
const
NFCScriptName& id)
const
{
return
this
->
strComponentName
.
length
() < id.
strComponentName
.
length
() &&
this
->
strFunctionName
.
length
() < id.
strFunctionName
.
length
();
}
bool
operator
== (
const
NFCScriptName& id)
const
{
if
(
this
->
strComponentName
!= id.
strComponentName
||
this
->
strFunctionName
!= id.
strFunctionName
)
{
return
false
;
}
return
true
;
}
NFCScriptName
(){}
NFCScriptName
(
const
std::string& strComponentName,
const
std::string& strFunctionName)
{
this
->
strComponentName
= strComponentName;
this
->
strFunctionName
= strFunctionName;
}
std::string strComponentName;
std::string strFunctionName;
};
class
NFCSriptData
{
public:
//
eventlist: id->ScriptName,FunctionName
NFMap<
int
, NFList<NFCScriptName>> mxEventData;
//
heartbeatlist: name->ScriptName,FunctionName
NFMap<std::string, NFList<NFCScriptName>> mxHeartBeatData;
//
propertycblist: name->ScriptName,FunctionName
NFMap<std::string, NFList<NFCScriptName>> mxPropertyCallBackData;
//
recordcblist: name->ScriptName,FunctionName
NFMap<std::string, NFList<NFCScriptName>> mxRecordCallBackData;
protected:
private:
};
class
NFIScriptModule
: public NFILogicModule, public NFMap<
NFIDENTID
, NFCSriptData>
{
public:
virtual
int
DoHeartBeatCommonCB
(
const
NFIDENTID
& self,
const
std::string& strHeartBeat,
const
float
fTime
,
const
int
nCount)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(pScriptData)
{
NFList<NFCScriptName>* pList = pScriptData->
mxHeartBeatData
.
GetElement
(strHeartBeat);
if
(pList)
{
NFCScriptName xScriptName;
bool
bRet = pList->
First
(xScriptName);
while
(bRet)
{
DoHeartBeatScript
(self, strHeartBeat,
fTime
, nCount, xScriptName.
strComponentName
, xScriptName.
strFunctionName
);
bRet = pList->
Next
(xScriptName);
}
}
}
return
0
;
}
virtual
int
DoEventCommonCB
(
const
NFIDENTID
& self,
const
int
nEventID,
const
NFIDataList& var)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(pScriptData)
{
NFList<NFCScriptName>* pList = pScriptData->
mxEventData
.
GetElement
(nEventID);
if
(pList)
{
NFCScriptName xScriptName;
bool
bRet = pList->
First
(xScriptName);
while
(bRet)
{
DoEventScript
(self, nEventID, xScriptName.
strComponentName
, xScriptName.
strFunctionName
, var);
bRet = pList->
Next
(xScriptName);
}
}
}
return
0
;
}
virtual
int
DoPropertyCommEvent
(
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
NFIDataList& oldVar,
const
NFIDataList& newVar)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(pScriptData)
{
NFList<NFCScriptName>* pList = pScriptData->
mxPropertyCallBackData
.
GetElement
(strPropertyName);
if
(pList)
{
NFCScriptName xScriptName;
bool
bRet = pList->
First
(xScriptName);
while
(bRet)
{
DoScriptPropertyCallBack
(self, strPropertyName, xScriptName.
strComponentName
, xScriptName.
strFunctionName
, oldVar, newVar);
bRet = pList->
Next
(xScriptName);
}
}
}
return
0
;
}
virtual
int
DoRecordCommonEvent
(
const
NFIDENTID
& self,
const
RECORD_EVENT_DATA
& xEventData,
const
NFIDataList& oldVar,
const
NFIDataList& newVar)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(pScriptData)
{
NFList<NFCScriptName>* pList = pScriptData->
mxRecordCallBackData
.
GetElement
(xEventData.
strRecordName
);
if
(pList)
{
NFCScriptName xScriptName;
bool
bRet = pList->
First
(xScriptName);
while
(bRet)
{
DoScriptRecordCallBack
(self, xEventData.
strRecordName
, xScriptName.
strComponentName
, xScriptName.
strFunctionName
, xEventData.
nOpType
, xEventData.
nRow
, xEventData.
nCol
, oldVar, newVar);
bRet = pList->
Next
(xScriptName);
}
}
}
return
0
;
}
virtual
int
DoClassCommonEvent
(NFILogicClassModule* pLogicClassModule,
const
NFIDENTID
& self,
const
std::string& strClassName,
const
CLASS_OBJECT_EVENT
eClassEvent,
const
NFIDataList& var)
{
std::string strSerializationName;
switch
(eClassEvent)
{
case
COE_CREATE_NODATA
:
strSerializationName =
"
Init
"
;
break
;
case
COE_CREATE_HASDATA
:
strSerializationName =
"
AfterInit
"
;
break
;
case
COE_BEFOREDESTROY
:
strSerializationName =
"
BeforeShut
"
;
break
;
case
COE_DESTROY
:
strSerializationName =
"
Shut
"
;
break
;
default
:
break
;
}
if
(!strSerializationName.
empty
())
{
NF_SHARE_PTR
<NFIComponentManager> pComponentManager = pLogicClassModule->
GetClassComponentManager
(strClassName);
if
(pComponentManager.
get
())
{
NF_SHARE_PTR
<NFIComponent> pComponent = pComponentManager->
First
();
while
(pComponent.
get
() && pComponent->
Enable
())
{
DoScript
(self, pComponent->
GetComponentName
(), strSerializationName, var);
pComponent = pComponentManager->
Next
();
}
}
}
return
0
;
}
//
call script
virtual
int
DoScript
(
const
NFIDENTID
& self,
const
std::string& strComponentName,
const
std::string& strFunction,
const
NFCDataList& arg) = 0;
virtual
int
DoEventScript
(
const
NFIDENTID
& self,
const
int
nEventID,
const
std::string& strComponentName,
const
std::string& strFunction,
const
NFCDataList& arg) = 0;
virtual
int
DoHeartBeatScript
(
const
NFIDENTID
& self,
const
std::string& strHeartBeat,
const
float
fTime
,
const
int
nCount, std::string& strComponentName,
const
std::string& strFunction) = 0;
virtual
int
DoScriptPropertyCallBack
(
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
std::string& strComponentName,
const
std::string& strFunction,
const
NFCDataList& oldVar,
const
NFCDataList& newVar) = 0;
virtual
int
DoScriptRecordCallBack
(
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
std::string& strComponentName,
const
std::string& strFunction,
const
int
nOpType,
const
int
nRow,
const
int
nCol,
const
NFCDataList& oldVar,
const
NFCDataList& newVar) = 0;
//
operating function
virtual
bool
AddPropertyCallBack
(
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
std::string& strComponentName,
const
std::string& strFunction)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(!pScriptData)
{
pScriptData =
new
NFCSriptData
();
AddElement
(self, pScriptData);
}
NFList<NFCScriptName>* pScriptNameList = pScriptData->
mxPropertyCallBackData
.
GetElement
(strPropertyName);
if
(!pScriptNameList)
{
pScriptNameList =
new
NFList<NFCScriptName>();
pScriptData->
mxPropertyCallBackData
.
AddElement
(strPropertyName, pScriptNameList);
}
NFCScriptName
xScriptName
(strComponentName, strFunction);
pScriptNameList->
Add
(xScriptName);
NFIKernelModule* pKernelModule =
dynamic_cast
<NFIKernelModule*>(
GetPluginManager
()->
FindModule
(
"
NFCKernelModule
"
));
pKernelModule->
AddPropertyCallBack
(self, strPropertyName,
this
, &NFIScriptModule::OnPropertyCB);
return
true
;
}
int
OnPropertyCB
(
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
NFIDataList& oldVar,
const
NFIDataList& newVar)
{
return
DoPropertyCommEvent
(self, strPropertyName, oldVar, newVar);
}
virtual
bool
AddRecordCallBack
(
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
std::string& strComponentName,
const
std::string& strFunction)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(!pScriptData)
{
pScriptData =
new
NFCSriptData
();
AddElement
(self, pScriptData);
}
NFList<NFCScriptName>* pScriptNameList = pScriptData->
mxRecordCallBackData
.
GetElement
(strRecordName);
if
(!pScriptNameList)
{
pScriptNameList =
new
NFList<NFCScriptName>();
pScriptData->
mxRecordCallBackData
.
AddElement
(strRecordName, pScriptNameList);
}
NFCScriptName
xScriptName
(strComponentName, strFunction);
pScriptNameList->
Add
(xScriptName);
NFIKernelModule* pKernelModule =
dynamic_cast
<NFIKernelModule*>(
GetPluginManager
()->
FindModule
(
"
NFCKernelModule
"
));
pKernelModule->
AddRecordCallBack
(self, strRecordName,
this
, &NFIScriptModule::OnRecordCB);
return
true
;
}
int
OnRecordCB
(
const
NFIDENTID
& self,
const
RECORD_EVENT_DATA
& xEventData,
const
NFIDataList& oldVar,
const
NFIDataList& newVar)
{
return
DoRecordCommonEvent
(self, xEventData, oldVar, newVar);
}
virtual
bool
AddHeartBeatCallBack
(
const
NFIDENTID
& self,
const
std::string& strHeartBeatName,
const
std::string& strComponentName,
const
std::string& strFunction,
const
float
fTime
,
const
int
nCount)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(!pScriptData)
{
pScriptData =
new
NFCSriptData
();
AddElement
(self, pScriptData);
}
NFList<NFCScriptName>* pScriptNameList = pScriptData->
mxHeartBeatData
.
GetElement
(strHeartBeatName);
if
(!pScriptNameList)
{
pScriptNameList =
new
NFList<NFCScriptName>();
pScriptData->
mxHeartBeatData
.
AddElement
(strHeartBeatName, pScriptNameList);
}
//
应该是同时直接向系统注册.
NFCScriptName
xScriptName
(strComponentName, strFunction);
pScriptNameList->
Add
(xScriptName);
NFIKernelModule* pKernelModule =
dynamic_cast
<NFIKernelModule*>(
GetPluginManager
()->
FindModule
(
"
NFCKernelModule
"
));
pKernelModule->
AddHeartBeat
(self, strHeartBeatName,
this
, &NFIScriptModule::OnHeartBeatCB,
fTime
, nCount);
return
true
;
}
int
OnHeartBeatCB
(
const
NFIDENTID
& self,
const
std::string& strHeartBeatName,
const
float
fTime
,
const
int
nCount)
{
return
DoHeartBeatCommonCB
(self, strHeartBeatName,
fTime
, nCount);
}
virtual
bool
AddEventCallBack
(
const
NFIDENTID
& self,
const
int
nEventID,
const
std::string& strComponentName,
const
std::string& strFunction)
{
NFCSriptData* pScriptData =
GetElement
(self);
if
(!pScriptData)
{
pScriptData =
new
NFCSriptData
();
AddElement
(self, pScriptData);
}
NFList<NFCScriptName>* pScriptNameList = pScriptData->
mxEventData
.
GetElement
(nEventID);
if
(!pScriptNameList)
{
pScriptNameList =
new
NFList<NFCScriptName>();
pScriptData->
mxEventData
.
AddElement
(nEventID, pScriptNameList);
}
NFCScriptName
xScriptName
(strComponentName, strFunction);
pScriptNameList->
Add
(xScriptName);
NFIKernelModule* pKernelModule =
dynamic_cast
<NFIKernelModule*>(
GetPluginManager
()->
FindModule
(
"
NFCKernelModule
"
));
pKernelModule->
AddEventCallBack
(self, nEventID,
this
, &NFIScriptModule::OnEventCB);
return
true
;
}
int
OnEventCB
(
const
NFIDENTID
& self,
const
int
nEventID,
const
NFIDataList& argVar)
{
return
DoEventCommonCB
(self, nEventID, argVar);
}
};
static
bool
KernelModule_DoEvent
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
int
nEventID,
const
NFCDataList& valueList)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
NFIEventProcessModule* pEventProcessModule =
dynamic_cast
<NFIEventProcessModule*>(pKernelModule->
GetPluginManager
()->
FindModule
(
"
NFCEventProcessModule
"
));
return
pEventProcessModule->
DoEvent
(self, nEventID, valueList);
}
static
bool
KernelModule_FindHeartBeat
(NFIKernelModule* pKernelModule,
const
NFIDENTID
& self,
const
std::string& strHeartBeatName)
{
return
pKernelModule->
FindHeartBeat
(self, strHeartBeatName);
}
static
bool
KernelModule_RemoveHeartBeat
(NFIKernelModule* pKernelModule,
const
NFIDENTID
& self,
const
std::string& strHeartBeatName)
{
return
pKernelModule->
RemoveHeartBeat
(self, strHeartBeatName);
}
//
/////////////////////////////////////////////////
static
bool
KernelModule_ExistElement
(NFIKernelModule* pKernelModule,
const
std::string& strConfigName)
{
NFIElementInfoModule* pElementInfoModule =
dynamic_cast
<NFIElementInfoModule*>(pKernelModule->
GetPluginManager
()->
FindModule
(
"
NFCElementInfoModule
"
));
return
pElementInfoModule->
ExistElement
(strConfigName);
}
static
NFINT64
KernelModule_GetElementPropertyInt
(
NFINT64
kernelAddress,
const
std::string& strConfigName,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
NFIElementInfoModule* pElementInfoModule =
dynamic_cast
<NFIElementInfoModule*>(pKernelModule->
GetPluginManager
()->
FindModule
(
"
NFCElementInfoModule
"
));
return
pElementInfoModule->
GetPropertyInt
(strConfigName, strPropertyName);
}
static
float
KernelModule_GetElementPropertyFloat
(
NFINT64
kernelAddress,
const
std::string& strConfigName,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
NFIElementInfoModule* pElementInfoModule =
dynamic_cast
<NFIElementInfoModule*>(pKernelModule->
GetPluginManager
()->
FindModule
(
"
NFCElementInfoModule
"
));
return
pElementInfoModule->
GetPropertyFloat
(strConfigName, strPropertyName);
}
static
double
KernelModule_GetElementPropertyDouble
(
NFINT64
kernelAddress,
const
std::string& strConfigName,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
NFIElementInfoModule* pElementInfoModule =
dynamic_cast
<NFIElementInfoModule*>(pKernelModule->
GetPluginManager
()->
FindModule
(
"
NFCElementInfoModule
"
));
return
pElementInfoModule->
GetPropertyDouble
(strConfigName, strPropertyName);
}
static
const
std::string&
KernelModule_GetElementPropertyString
(NFIKernelModule* pKernelModule,
const
std::string& strConfigName,
const
std::string& strPropertyName)
{
NFIElementInfoModule* pElementInfoModule =
dynamic_cast
<NFIElementInfoModule*>(pKernelModule->
GetPluginManager
()->
FindModule
(
"
NFCElementInfoModule
"
));
return
pElementInfoModule->
GetPropertyString
(strConfigName, strPropertyName);
}
static
bool
KernelModule_ExistContainer
(NFIKernelModule* pKernelModule,
const
int
nContainerIndex)
{
return
pKernelModule->
ExistContainer
(nContainerIndex);
}
static
bool
KernelModule_SetPropertyInt
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
int
nValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetPropertyInt
(self, strPropertyName, nValue);
}
static
bool
KernelModule_SetPropertyFloat
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
float
fValue
)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetPropertyFloat
(self, strPropertyName,
fValue
);
}
static
bool
KernelModule_SetPropertyDouble
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
double
dValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetPropertyDouble
(self, strPropertyName, dValue);
}
static
bool
KernelModule_SetPropertyString
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
std::string& strValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetPropertyString
(self, strPropertyName, strValue);
}
static
bool
KernelModule_SetPropertyObject
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName,
const
NFIDENTID
& objectValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetPropertyObject
(self, strPropertyName, objectValue);
}
static
NFINT64
KernelModule_GetPropertyInt
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetPropertyInt
(self, strPropertyName);
}
static
float
KernelModule_GetPropertyFloat
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetPropertyFloat
(self, strPropertyName);
}
static
double
KernelModule_GetPropertyDouble
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetPropertyDouble
(self, strPropertyName);
}
static
const
std::string&
KernelModule_GetPropertyString
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetPropertyString
(self, strPropertyName);
}
static
NFIDENTID
KernelModule_GetPropertyObject
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strPropertyName)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetPropertyObject
(self, strPropertyName);
}
static
bool
KernelModule_SetRecordInt
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol,
const
int
nValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetRecordInt
(self, strRecordName, nRow, nCol, nValue);
}
static
bool
KernelModule_SetRecordFloat
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol,
const
float
fValue
)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetRecordFloat
(self, strRecordName, nRow, nCol,
fValue
);
}
static
bool
KernelModule_SetRecordDouble
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol,
const
double
dValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetRecordDouble
(self, strRecordName, nRow, nCol, dValue);
}
static
bool
KernelModule_SetRecordString
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol,
const
std::string& strValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetRecordString
(self, strRecordName, nRow, nCol, strValue);
}
static
bool
KernelModule_SetRecordObject
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol,
const
NFIDENTID
& objectValue)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
SetRecordObject
(self, strRecordName, nRow, nCol, objectValue);
}
static
NFINT64
KernelModule_GetRecordInt
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetRecordInt
(self, strRecordName, nRow, nCol);
}
static
float
KernelModule_GetRecordFloat
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetRecordFloat
(self, strRecordName, nRow, nCol);
}
static
double
KernelModule_GetRecordDouble
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetRecordDouble
(self, strRecordName, nRow, nCol);
}
static
const
std::string&
KernelModule_GetRecordString
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetRecordString
(self, strRecordName, nRow, nCol);
}
static
NFIDENTID
KernelModule_GetRecordObject
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
int
nRow,
const
int
nCol)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
return
pKernelModule->
GetRecordObject
(self, strRecordName, nRow, nCol);
}
static
int
KernelModule_AddRow
(
NFINT64
kernelAddress,
const
NFIDENTID
& self,
const
std::string& strRecordName,
const
NFCDataList& var)
{
NFIKernelModule* pKernelModule = (NFIKernelModule*)kernelAddress;
NF_SHARE_PTR
<NFIRecord> pRecord = pKernelModule->
FindRecord
(self, strRecordName);
if
(
nullptr
== pRecord)
{
return
-
1
;
}
return
pRecord->
AddRow
(-
1
, var);
}
#
endif
Back
|
FazBrowse Home
|
New Git URL