implemented nxsl class "Interface" and function GetInterfaceObject; manual updated
[public/netxms.git] / src / server / include / nms_script.h
1 /*
2 ** NetXMS - Network Management System
3 ** Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 ** File: nms_script.h
20 **
21 **/
22
23 #ifndef _nms_script_h_
24 #define _nms_script_h_
25
26
27 //
28 // "NetXMS object" class
29 //
30
31 class NXSL_NetObjClass : public NXSL_Class
32 {
33 public:
34 NXSL_NetObjClass();
35
36 virtual NXSL_Value *getAttr(NXSL_Object *pObject, const TCHAR *pszAttr);
37 };
38
39
40 //
41 // "NetXMS node" class
42 //
43
44 class NXSL_NodeClass : public NXSL_Class
45 {
46 public:
47 NXSL_NodeClass();
48
49 virtual NXSL_Value *getAttr(NXSL_Object *pObject, const TCHAR *pszAttr);
50 };
51
52
53 //
54 // "NetXMS interface" class
55 //
56
57 class NXSL_InterfaceClass : public NXSL_Class
58 {
59 public:
60 NXSL_InterfaceClass();
61
62 virtual NXSL_Value *getAttr(NXSL_Object *pObject, const TCHAR *pszAttr);
63 };
64
65
66 //
67 // "NetXMS event" class
68 //
69
70 class NXSL_EventClass : public NXSL_Class
71 {
72 public:
73 NXSL_EventClass();
74
75 virtual NXSL_Value *getAttr(NXSL_Object *pObject, const TCHAR *pszAttr);
76 };
77
78
79 //
80 // "DCI" class
81 //
82
83 class NXSL_DciClass : public NXSL_Class
84 {
85 public:
86 NXSL_DciClass();
87
88 virtual NXSL_Value *getAttr(NXSL_Object *object, const TCHAR *attr);
89 };
90
91
92 //
93 // Server's default script environment
94 //
95
96 class NXSL_ServerEnv : public NXSL_Environment
97 {
98 public:
99 NXSL_ServerEnv();
100
101 virtual void trace(int level, const TCHAR *text);
102 };
103
104
105 //
106 // Functions
107 //
108
109 void LoadScripts();
110 void ReloadScript(DWORD dwScriptId);
111 BOOL IsValidScriptId(DWORD dwId);
112
113
114 //
115 // Global variables
116 //
117
118 extern NXSL_Library *g_pScriptLibrary;
119 extern NXSL_NetObjClass g_nxslNetObjClass;
120 extern NXSL_NodeClass g_nxslNodeClass;
121 extern NXSL_InterfaceClass g_nxslInterfaceClass;
122 extern NXSL_EventClass g_nxslEventClass;
123 extern NXSL_DciClass g_nxslDciClass;
124
125 #endif