My Project
INPLRuntimeState.h
1 #pragma once
2 #include "NPLTypes.h"
3 #include <string>
4 
5 namespace NPL
6 {
7  class INPLRuntime;
8  class INPLActivationFile;
13  {
22  };
23 
28  {
29  public:
31  virtual const std::string& GetName() const = 0;
32 
79  virtual int activate(const char * sNPLFilename, const char* sCode, int nCodeLength=0, int priority=2, int reliability=4) = 0;
80 
89  virtual NPLReturnCode Activate_async(const std::string & filepath, const char * code = NULL,int nLength=0, int priority=0) = 0;
90 
92  virtual NPLReturnCode ActivateLocal(const char* filepath, const char * code = NULL,int nLength=0, int priority=0) = 0;
93 
100  virtual NPLReturnCode Activate_async(NPLMessage_ptr& msg, int priority=0) = 0;
101 
110  virtual NPLReturnCode SendMessage(NPLMessage_ptr& msg, int priority=0) = 0;
111 
113  virtual const char* GetCurrentMsg() = 0;
114 
116  virtual int GetCurrentMsgLength() = 0;
117 
119  virtual INPLRuntime* GetNPLRuntime() = 0;
120 
126  virtual void WriteLog(const char* text, int nTextLen=0, int nLogType = 0) = 0;
127 
129  //
130  // Timer functions
131  //
133 
145  virtual bool SetTimer(int nIDEvent, float fElapse, const char* sNeuronFile) = 0;
146 
154  virtual bool KillTimer(int nIDEvent) = 0;
155 
166  virtual bool ChangeTimer(int nIDEvent, int dueTime, int period) = 0;
167 
172  virtual void RegisterFile(const char* sFilename, INPLActivationFile* pFileHandler = NULL) = 0;
173 
175  virtual void call(const char * sNPLFilename, const char* sCode, int nCodeLength = 0) = 0;
176  };
177 }
virtual int activate(const char *sNPLFilename, const char *sCode, int nCodeLength=0, int priority=2, int reliability=4)=0
activate the specified file.
virtual NPLReturnCode SendMessage(NPLMessage_ptr &msg, int priority=0)=0
send a message to the current message queue.
virtual NPLReturnCode ActivateLocal(const char *filepath, const char *code=NULL, int nLength=0, int priority=0)=0
same as Activate_async, except that it is a short cut name.
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
virtual void call(const char *sNPLFilename, const char *sCode, int nCodeLength=0)=0
synchronous function call
INPLRuntimeState interface for DLL interface.
Definition: INPLRuntimeState.h:27
virtual void RegisterFile(const char *sFilename, INPLActivationFile *pFileHandler=NULL)=0
function to register the a file handler in the current NPL state, so that it is callable from NPL scr...
same as NPLRuntimeStateType_NPL, but with externally set lua state
Definition: INPLRuntimeState.h:21
virtual bool ChangeTimer(int nIDEvent, int dueTime, int period)=0
Changes the start time and the interval between method invocations for a timer, using 32-bit signed i...
virtual void WriteLog(const char *text, int nTextLen=0, int nLogType=0)=0
write a log message
virtual int GetCurrentMsgLength()=0
get length of the current message
the default NPL runtime state, with all NPL and ParaEngine functions loaded. it will consume about 1M...
Definition: INPLRuntimeState.h:15
virtual const char * GetCurrentMsg()=0
get a pointer to the current message
virtual bool KillTimer(int nIDEvent)=0
Destroys the specified timer [thread safe].
Definition: inftrees.h:24
virtual NPLReturnCode Activate_async(const std::string &filepath, const char *code=NULL, int nLength=0, int priority=0)=0
activate the specified file in this runtime state.
Definition: INPLAcitvationFile.h:18
it consumes nothing. and is usually used with DLL plugins.
Definition: INPLRuntimeState.h:19
virtual INPLRuntime * GetNPLRuntime()=0
get the NPL runtime environment
NPL Runtime Environment interface.
Definition: INPLRuntime.h:30
virtual bool SetTimer(int nIDEvent, float fElapse, const char *sNeuronFile)=0
creates a timer with the specified time-out value [thread safe]
NPLRuntimeStateType
The types of CNPLRuntimeState.
Definition: INPLRuntimeState.h:12
the light-weighter NPL runtime state, with only NPL and very limited functions loaded.
Definition: INPLRuntimeState.h:17
virtual const std::string & GetName() const =0
return the name of this runtime state.