diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/agent__timer_8cpp-source.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/agent__timer_8cpp-source.html')
-rw-r--r-- | docs/doxygen/nel/agent__timer_8cpp-source.html | 877 |
1 files changed, 877 insertions, 0 deletions
diff --git a/docs/doxygen/nel/agent__timer_8cpp-source.html b/docs/doxygen/nel/agent__timer_8cpp-source.html new file mode 100644 index 00000000..3aa9338f --- /dev/null +++ b/docs/doxygen/nel/agent__timer_8cpp-source.html @@ -0,0 +1,877 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>agent_timer.cpp</h1><a href="agent__timer_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00006 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00007 <font class="comment"> *</font> +00008 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00009 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00010 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00011 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00012 <font class="comment"> * any later version.</font> +00013 <font class="comment"></font> +00014 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00015 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00016 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00017 <font class="comment"> * General Public License for more details.</font> +00018 <font class="comment"></font> +00019 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00020 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00021 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00022 <font class="comment"> * MA 02111-1307, USA.</font> +00023 <font class="comment"> */</font> +00024 <font class="preprocessor">#include "<a class="code" href="time__nl_8h.html">nel/misc/time_nl.h</a>"</font> +00025 <font class="preprocessor">#include "<a class="code" href="nl__ai_8h.html">nel/ai/nl_ai.h</a>"</font> +00026 <font class="preprocessor">#include "<a class="code" href="agent__timer_8h.html">nel/ai/agent/agent_timer.h</a>"</font> +00027 <font class="preprocessor">#include "<a class="code" href="agent__method__def_8h.html">nel/ai/agent/agent_method_def.h</a>"</font> +00028 <font class="preprocessor">#include "<a class="code" href="agent__digital_8h.html">nel/ai/agent/agent_digital.h</a>"</font> +00029 <font class="preprocessor">#include "<a class="code" href="object__unknown_8h.html">nel/ai/script/object_unknown.h</a>"</font> +00030 +00031 <font class="keyword">namespace </font>NLAIAGENT +00032 { +00033 <font class="comment">//##################################</font> +00034 <font class="comment">//CAgentManagerTimer</font> +00035 <font class="comment">//##################################</font> +<a name="l00036"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a0">00036</a> CAgentManagerTimer::CAgentManagerTimer(<font class="keyword">const</font> CAgentManagerTimer &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>):CAgentScript(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>), _Time(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>._Time) +00037 { +00038 +00039 } +00040 +<a name="l00041"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a1">00041</a> CAgentManagerTimer::CAgentManagerTimer(IAgentManager *m):CAgentScript(m), _Time(0) +00042 { +00043 } +00044 +<a name="l00045"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a2">00045</a> CAgentManagerTimer::CAgentManagerTimer(IAgentManager *m, IBasicAgent *a, <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> &<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>, <a class="code" href="classNLAISCRIPT_1_1CAgentClass.html">NLAISCRIPT::CAgentClass</a> *c):CAgentScript(m,a,v,c), _Time(0) +00046 { +00047 } +00048 +<a name="l00049"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a3">00049</a> CAgentManagerTimer::~CAgentManagerTimer() +00050 { +00051 } +00052 +<a name="l00053"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#z148_0">00053</a> <font class="keywordtype">void</font> CAgentManagerTimer::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is) +00054 { +00055 } +<a name="l00056"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#z148_1">00056</a> <font class="keywordtype">void</font> CAgentManagerTimer::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os) +00057 { +00058 } +<a name="l00059"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#z148_2">00059</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentManagerTimer::clone()<font class="keyword"> const</font> +00060 <font class="keyword"> </font>{ +00061 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a0">CAgentManagerTimer</a>(*<font class="keyword">this</font>); +00062 } +<a name="l00063"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#z148_3">00063</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentManagerTimer::newInstance()<font class="keyword"> const</font> +00064 <font class="keyword"> </font>{ +00065 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a0">CAgentManagerTimer</a>(NULL); +00066 } +00067 +<a name="l00068"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#z148_4">00068</a> <font class="keywordtype">void</font> CAgentManagerTimer::getDebugString(std::string &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>)<font class="keyword"> const</font> +00069 <font class="keyword"> </font>{ +00070 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <a class="code" href="namespaceNLAIC.html#a5">NLAIC::stringGetBuild</a>(<font class="stringliteral">"CAgentManagerTimer <%d>"</font>,<a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#o0">_Time</a>); +00071 } +00072 +<a name="l00073"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#z148_5">00073</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CAgentManagerTimer::getType()<font class="keyword"> const</font> +00074 <font class="keyword"> </font>{ +00075 <font class="keywordflow">return</font> *<a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p4">IdAgentTimer</a>; +00076 } +00077 +<a name="l00078"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a4">00078</a> IObjectIA::CProcessResult CAgentManagerTimer::runActivity() +00079 { +00080 <a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#o0">_Time</a> ++; +00081 <font class="keywordflow">return</font> IObjectIA::CProcessResult(); +00082 } +00083 +00084 +<a name="l00085"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p4">00085</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> *CAgentManagerTimer::IdAgentTimer = NULL; +<a name="l00086"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p1">00086</a> NLMISC::CSynchronized<CAgentScript *> *CAgentManagerTimer::TimerManager = NULL; +<a name="l00087"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p2">00087</a> <a class="code" href="classNLMISC_1_1IThread.html">NLMISC::IThread</a> *CAgentManagerTimer::TimerManagerRun = NULL; +<a name="l00088"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p3">00088</a> CAgentManagerTimer::CRunTimer *CAgentManagerTimer::RunTimer = NULL; +<a name="l00089"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p0">00089</a> <font class="keywordtype">bool</font> CAgentManagerTimer::IsRunning = <font class="keyword">false</font>; +00090 +<a name="l00091"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#p5">00091</a> <font class="keyword">const</font> <font class="keywordtype">int</font> CAgentManagerTimer::ClockTick = 40; +00092 +<a name="l00093"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#d0">00093</a> <font class="keywordtype">void</font> CAgentManagerTimer::initClass() +00094 { +00095 <font class="keywordflow">if</font>(!CAgentManagerTimer::IsRunning) +00096 { +00097 <a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a0">CAgentManagerTimer</a> *h = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#a0">CAgentManagerTimer</a>(NULL); +00098 CAgentManagerTimer::IdAgentTimer = <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> (<font class="stringliteral">"AgentStaticManagerTimer"</font>, <a class="code" href="classNLAIC_1_1CSelfClassFactory.html">NLAIC::CSelfClassFactory</a>((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> &)*h), +00099 <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a>(<a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s4">NLAIC::CTypeOfObject::tAgent</a>), +00100 <a class="code" href="classNLAIC_1_1CTypeOfOperator.html">NLAIC::CTypeOfOperator</a>(<a class="code" href="classNLAIC_1_1CTypeOfOperator.html#s15s0">NLAIC::CTypeOfOperator::opNone</a>)); +00101 +00102 CAgentManagerTimer::TimerManager = <font class="keyword">new</font> NLMISC::CSynchronized<CAgentScript *>( <font class="stringliteral">"CAgentManagerTimer::TimerManager"</font> ); +00103 { +00104 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00105 accessor.value() = h; +00106 } +00107 <font class="comment">/*CAgentManagerTimer::RunTimer = new CAgentManagerTimer::CRunTimer();</font> +00108 <font class="comment"> CAgentManagerTimer::TimerManagerRun = NLMISC::IThread::create(CAgentManagerTimer::RunTimer);</font> +00109 <font class="comment"> CAgentManagerTimer::TimerManagerRun->start();</font> +00110 <font class="comment"> CAgentManagerTimer::IsRunning = true;*/</font> +00111 CAgentManagerTimer::IsRunning = <font class="keyword">false</font>; +00112 } +00113 } +00114 +<a name="l00115"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer.html#d1">00115</a> <font class="keywordtype">void</font> CAgentManagerTimer::releaseClass() +00116 { +00117 { +00118 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00119 accessor.value()->release(); +00120 } +00121 <font class="keyword">delete</font> CAgentManagerTimer::TimerManager; +00122 <font class="keyword">delete</font> CAgentManagerTimer::IdAgentTimer; +00123 CAgentManagerTimer::IdAgentTimer = NULL; +00124 CAgentManagerTimer::TimerManager = NULL; +00125 +00126 <font class="keywordflow">if</font>(CAgentManagerTimer::TimerManagerRun) +00127 { +00128 CAgentManagerTimer::TimerManagerRun-><a class="code" href="classNLMISC_1_1IThread.html#a2">terminate</a>(); +00129 <font class="keyword">delete</font> CAgentManagerTimer::TimerManagerRun; +00130 <font class="keyword">delete</font> CAgentManagerTimer::RunTimer; +00131 CAgentManagerTimer::IsRunning = <font class="keyword">false</font>; +00132 } +00133 +00134 } +00135 +00136 <font class="comment">//##################################</font> +00137 <font class="comment">//CAgentManagerTimer::CRunTimer</font> +00138 <font class="comment">//##################################</font> +00139 +<a name="l00140"></a><a class="code" href="classNLAIAGENT_1_1CAgentManagerTimer_1_1CRunTimer.html#a2">00140</a> <font class="keywordtype">void</font> CAgentManagerTimer::CRunTimer::run() +00141 { +00142 +00143 NLMISC::TTime start = <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a>(); +00144 NLMISC::TTime time; +00145 <font class="keywordflow">while</font>(1) +00146 { +00147 NLMISC::TTime <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>= <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a>(); +00148 time = (<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> - start); +00149 <font class="keywordflow">if</font>(time > (uint)CAgentManagerTimer::ClockTick) +00150 { +00151 start = <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a>(); +00152 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00153 accessor.value()->run(); +00154 } +00155 <a class="code" href="namespaceNLMISC.html#a236">NLMISC::nlSleep</a>((uint)(CAgentManagerTimer::ClockTick/2)); +00156 <font class="comment">//NLMISC::nlSleep(CAgentManagerTimer::ClockTick);</font> +00157 } +00158 } +00159 +00160 <font class="comment">//##################################</font> +00161 <font class="comment">//CLibTimerManager</font> +00162 <font class="comment">//##################################</font> +<a name="l00163"></a><a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#p1">00163</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> *CLibTimerManager::IdAgentManagerTimer = NULL; +<a name="l00164"></a><a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#p0">00164</a> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a> **CLibTimerManager::StaticMethod = NULL; +00165 +<a name="l00166"></a><a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#a2">00166</a> NLAIAGENT::tQueue CLibTimerManager::isMember(<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IVarName.html">NLAIAGENT::IVarName</a> *className,<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IVarName.html">NLAIAGENT::IVarName</a> *methodName,<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> &<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>)<font class="keyword"> const</font> +00167 <font class="keyword"> </font>{ +00168 NLAIAGENT::tQueue <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="namespaceNLAIAGENT.html#a42">NLAIAGENT::isTemplateMember</a>(CLibTimerManager::StaticMethod,CLibTimerManager::TLastM,IObjectIA::getMethodIndexSize(),className,methodName,param); +00169 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.size()) <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>; +00170 <font class="keywordflow">else</font> <font class="keywordflow">return</font> IObjectIA::isMember(className,methodName,param); +00171 } +00172 +00173 +<a name="l00174"></a><a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#a3">00174</a> <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> CLibTimerManager::runMethodeMember(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *o) +00175 { +00176 <a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a> = (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *)o; +00177 +00178 <font class="keywordflow">switch</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - IObjectIA::getMethodIndexSize()) +00179 { +00180 <font class="keywordflow">case</font> CLibTimerManager::TGetTimer: +00181 { +00182 <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> a; +00183 { +00184 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00185 a = accessor.value()->getDynamicAgent(param); +00186 } +00187 <font class="keywordflow">return</font> a; +00188 } +00189 <font class="keywordflow">default</font>: +00190 <font class="keywordflow">return</font> IObjectIA::runMethodeMember(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,o); +00191 } +00192 } +00193 +<a name="l00194"></a><a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#d0">00194</a> <font class="keywordtype">void</font> CLibTimerManager::initClass() +00195 { +00196 <a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#a0">CLibTimerManager</a> h; +00197 CLibTimerManager::IdAgentManagerTimer = <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> (<font class="stringliteral">"AgentManagerTimer"</font>, <a class="code" href="classNLAIC_1_1CSelfClassFactory.html">NLAIC::CSelfClassFactory</a>((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> &)h), +00198 <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a>(<a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s4">NLAIC::CTypeOfObject::tAgent</a>), +00199 <a class="code" href="classNLAIC_1_1CTypeOfOperator.html">NLAIC::CTypeOfOperator</a>(<a class="code" href="classNLAIC_1_1CTypeOfOperator.html#s15s0">NLAIC::CTypeOfOperator::opNone</a>)); +00200 +00201 <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> *ParamString = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>(1,<font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>(<font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1CStringType.html#p0">NLAIAGENT::CStringType::IdStringType</a>))); +00202 CLibTimerManager::StaticMethod = <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a> *[CLibTimerManager::TLastM]; +00203 +00204 CLibTimerManager::StaticMethod[CLibTimerManager::TGetTimer] = +00205 <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a>(<a class="code" href="agent__method__def_8h.html#a14">_GETTIMER_</a>, +00206 CLibTimerManager::TGetTimer, +00207 ParamString,<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#s26s22">NLAIAGENT::CAgentScript::CheckAll</a>, +00208 1, <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a>( +00209 <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>( +00210 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(CVectorGroupManager::IdVectorGroupManager)))); +00211 } +00212 +<a name="l00213"></a><a class="code" href="classNLAIAGENT_1_1CLibTimerManager.html#d1">00213</a> <font class="keywordtype">void</font> CLibTimerManager::releaseClass() +00214 { +00215 <font class="keyword">delete</font> CLibTimerManager::IdAgentManagerTimer; +00216 <font class="keywordtype">int</font> i; +00217 <font class="keywordflow">for</font>(i = 0; i < CLibTimerManager::TLastM; i++) +00218 { +00219 <font class="keyword">delete</font> CLibTimerManager::StaticMethod[i]; +00220 } +00221 <font class="keyword">delete</font> CLibTimerManager::StaticMethod; +00222 } +00223 +00224 <font class="comment">//##################################</font> +00225 <font class="comment">//CAgentWatchTimer</font> +00226 <font class="comment">//##################################</font> +<a name="l00227"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#p1">00227</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> *CAgentWatchTimer::IdAgentWatchTimer = NULL; +00228 +00229 +<a name="l00230"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a0">00230</a> CAgentWatchTimer::CAgentWatchTimer(): CAgentScript(NULL),_Clock(0) +00231 { +00232 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n3">_CallIter</a> = <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end(); +00233 } +<a name="l00234"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a3">00234</a> CAgentWatchTimer::CAgentWatchTimer(<font class="keyword">const</font> CAgentWatchTimer &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>):CAgentScript(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>), _Clock(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>._Clock),_Call(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>._Call) +00235 { +00236 <a class="code" href="classstd_1_1list.html">std::list<std::pair< IConnectIA *, std::pair<IMessageBase *, sint32></a> > >::iterator i = <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.begin(); +00237 <font class="keywordflow">while</font>(i != <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end()) +00238 { +00239 <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a7">connect</a>((*i).first); +00240 std::pair<IMessageBase *, sint32> p = ((*i).second); +00241 p.first->incRef(); +00242 i ++; +00243 } +00244 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n3">_CallIter</a> = <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end(); +00245 +00246 } +<a name="l00247"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a1">00247</a> CAgentWatchTimer::CAgentWatchTimer(IAgentManager *m):CAgentScript(m), _Clock(0)<font class="comment">/*,_Call(NULL),_MSG(NULL)*/</font> +00248 { +00249 } +<a name="l00250"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a2">00250</a> CAgentWatchTimer::CAgentWatchTimer(IAgentManager *m, IBasicAgent *a, <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> &<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>, <a class="code" href="classNLAISCRIPT_1_1CAgentClass.html">NLAISCRIPT::CAgentClass</a> *c):CAgentScript(m,a,v,c), _Clock(0)<font class="comment">/*,_Call(NULL),_MSG(NULL)*/</font> +00251 { +00252 } +<a name="l00253"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a4">00253</a> CAgentWatchTimer::~CAgentWatchTimer() +00254 { +00255 <a class="code" href="classstd_1_1list.html">std::list<std::pair< IConnectIA *, std::pair<IMessageBase *, sint32></a> > >::iterator i = <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.begin(); +00256 <font class="keywordflow">while</font>(i != <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end()) +00257 { +00258 std::pair<IMessageBase *, sint32> p = ((*i++).second); +00259 IMessageBase * m = p.first; +00260 m->release(); +00261 } +00262 +00263 } +00264 +<a name="l00265"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a5">00265</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentWatchTimer::clone()<font class="keyword"> const</font> +00266 <font class="keyword"> </font>{ +00267 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a0">CAgentWatchTimer</a>(*<font class="keyword">this</font>); +00268 } +00269 +<a name="l00270"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a6">00270</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentWatchTimer::newInstance()<font class="keyword"> const</font> +00271 <font class="keyword"> </font>{ +00272 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a0">CAgentWatchTimer</a>(); +00273 } +00274 +<a name="l00275"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a7">00275</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CAgentWatchTimer::getType()<font class="keyword"> const</font> +00276 <font class="keyword"> </font>{ +00277 <font class="keywordflow">return</font> *<a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#p1">IdAgentWatchTimer</a>; +00278 } +00279 +<a name="l00280"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a18">00280</a> IObjectIA::CProcessResult CAgentWatchTimer::runActivity() +00281 { +00282 NLMISC::TTicks time = <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a> () - <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n1">_DTime</a>; +00283 <font class="keywordflow">if</font>((sint) (time) >= <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n0">_Clock</a>) +00284 { +00285 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a16">tellBroker</a>(); +00286 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a4">setState</a>(<a class="code" href="namespaceNLAIAGENT.html#a50a6">processToKill</a>,NULL); +00287 } +00288 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">getState</a>(); +00289 } +00290 +<a name="l00291"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a16">00291</a> <font class="keywordtype">bool</font> CAgentWatchTimer::tellBroker() +00292 { +00293 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n3">_CallIter</a> == <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end()) +00294 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n3">_CallIter</a> = <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.begin(); +00295 <font class="keywordflow">while</font>(<a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n3">_CallIter</a> != <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end()) +00296 { +00297 std::pair<IMessageBase *, sint32> p = ((*_CallIter).second); +00298 IMessageBase *msg = (IMessageBase *)p.first; +00299 msg->incRef(); +00300 <font class="keywordflow">if</font>((*_CallIter).first->getState().ResultState == NLAIAGENT::processIdle) (*_CallIter).first->sendMessage((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg); +00301 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n3">_CallIter</a> ++; +00302 <font class="comment">/*n ++;</font> +00303 <font class="comment"> if(n >= 10) return false;*/</font> +00304 } +00305 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00306 } +00307 +<a name="l00308"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a12">00308</a> <font class="keywordtype">void</font> CAgentWatchTimer::addAttrib(IConnectIA *c,IMessageBase *msg) +00309 { +00310 <font class="preprocessor">#ifdef NL_DEBUG</font> +00311 <font class="preprocessor"></font> <font class="keywordflow">if</font>(c == NULL || msg == NULL) +00312 { +00313 <font class="keywordflow">throw</font>; +00314 } +00315 <font class="preprocessor">#endif</font> +00316 <font class="preprocessor"></font> <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a7">connect</a>(c); +00317 <font class="keyword">static</font> CStringVarName sRunTell(<font class="stringliteral">"RunTell"</font>); +00318 +00319 +00320 <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>(<font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(msg->getType())); +00321 <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> <a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>(1,t); +00322 +00323 +00324 sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> = -1; +00325 +00326 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = c->isMember(NULL,&sRunTell,param); +00327 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.size()) <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index; +00328 +00329 msg->setSender(<font class="keyword">this</font>); +00330 msg->setPerformatif(IMessageBase::PTell); +00331 msg->setMethodIndex(0,<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>); +00332 +00333 std::pair<IMessageBase *, sint32> p (msg,<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>); +00334 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.push_front(std::pair< <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#b0">IConnectIA</a> *, std::pair<IMessageBase *, sint32> > (c,p)); +00335 +00336 } +00337 +<a name="l00338"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a9">00338</a> <font class="keywordtype">void</font> CAgentWatchTimer::onKill(IConnectIA *a) +00339 { +00340 <font class="keywordflow">if</font>(!<a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a14">detach</a>(a,<font class="keyword">false</font>)) CAgentScript::onKill(a); +00341 } +00342 +<a name="l00343"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a15">00343</a> <font class="keywordtype">bool</font> CAgentWatchTimer::detach(IConnectIA *a,<font class="keywordtype">bool</font> deleteFromConnection) +00344 { +00345 <a class="code" href="classstd_1_1list.html">std::list<std::pair< IConnectIA *, std::pair<IMessageBase *, sint32></a> > >::iterator i = <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.begin(); +00346 <font class="keywordflow">while</font>(i != <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end()) +00347 { +00348 <font class="keywordflow">if</font>((*i).first == a) +00349 { +00350 (*i).second.first->release(); +00351 <font class="keywordflow">break</font>; +00352 } +00353 i++; +00354 } +00355 +00356 <font class="keywordflow">if</font>(i != <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.end()) +00357 { +00358 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.erase(i); +00359 <font class="keywordflow">if</font>(!<a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n2">_Call</a>.size()) <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a14">detach</a>(); +00360 +00361 <font class="keywordflow">if</font>(deleteFromConnection) +00362 { +00363 <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a8">removeConnection</a>(a); +00364 } +00365 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00366 } +00367 <font class="keywordflow">else</font> <font class="keywordflow">return</font> <font class="keyword">false</font>; +00368 } +00369 +<a name="l00370"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a8">00370</a> <font class="keywordtype">void</font> CAgentWatchTimer::getDebugString(std::string &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>)<font class="keyword"> const</font> +00371 <font class="keyword"> </font>{ +00372 std::string <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>; +00373 ((<font class="keyword">const</font> IWordNumRef &)*<font class="keyword">this</font>).getNumIdent().getDebugString(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>); +00374 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = <a class="code" href="namespaceNLAIC.html#a5">NLAIC::stringGetBuild</a>(<font class="stringliteral">"timer: %s"</font>,<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.c_str()); +00375 } +00376 +<a name="l00377"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a14">00377</a> <font class="keywordtype">void</font> CAgentWatchTimer::detach() +00378 { +00379 <font class="comment">/*_Call = NULL;</font> +00380 <font class="comment"> if(_MSG != NULL) _MSG->release();</font> +00381 <font class="comment"> _MSG = NULL;*/</font> +00382 CVectorGroupType g(1); +00383 std::string <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>; +00384 ((<font class="keyword">const</font> IWordNumRef &)*<font class="keyword">this</font>).getNumIdent().getDebugString(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>); +00385 g.set(0,<font class="keyword">new</font> CStringType(CStringVarName(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>.c_str()))); +00386 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>; +00387 <font class="keywordflow">if</font>(CAgentManagerTimer::TimerManager != NULL) +00388 { +00389 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00390 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = accessor.value()->removeDynamic(&g); +00391 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result != NULL) <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result->release(); +00392 <font class="comment">//release();</font> +00393 } +00394 } +00395 +<a name="l00396"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a13">00396</a> <font class="keywordtype">void</font> CAgentWatchTimer::attach() +00397 { +00398 CVectorGroupType g(2); +00399 std::string <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>; +00400 ((<font class="keyword">const</font> IWordNumRef &)*<font class="keyword">this</font>).getNumIdent().getDebugString(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>); +00401 g.set(0,<font class="keyword">new</font> CStringType(CStringVarName(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>.c_str()))); +00402 this-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>(); +00403 g.set(1,<font class="keyword">this</font>); +00404 { +00405 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00406 accessor.value()->addDynamicAgent(&g); +00407 } +00408 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n1">_DTime</a> = <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a> (); +00409 } +00410 +<a name="l00411"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a20">00411</a> <font class="keywordtype">int</font> CAgentWatchTimer::getBaseMethodCount()<font class="keyword"> const</font> +00412 <font class="keyword"> </font>{ +00413 <font class="keywordflow">return</font> CAgentScript::getBaseMethodCount() + CAgentWatchTimer::TLastM; +00414 } +00415 +00416 +<a name="l00417"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a22">00417</a> sint32 CAgentWatchTimer::getMethodIndexSize()<font class="keyword"> const</font> +00418 <font class="keyword"> </font>{ +00419 <font class="keywordflow">return</font> CAgentScript::getMethodIndexSize() + CAgentWatchTimer::TLastM; +00420 } +00421 +00422 +00423 +<a name="l00424"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a21">00424</a> NLAIAGENT::tQueue CAgentWatchTimer::isMember(<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IVarName.html">NLAIAGENT::IVarName</a> *className,<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IVarName.html">NLAIAGENT::IVarName</a> *methodName,<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> &<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>)<font class="keyword"> const</font> +00425 <font class="keyword"> </font>{ +00426 NLAIAGENT::tQueue <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="namespaceNLAIAGENT.html#a42">NLAIAGENT::isTemplateMember</a>(CAgentWatchTimer::StaticMethod,CAgentWatchTimer::TLastM,CAgentScript::getMethodIndexSize(),className,methodName,param); +00427 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.size()) <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>; +00428 <font class="keywordflow">else</font> <font class="keywordflow">return</font> CAgentScript::isMember(className,methodName,param); +00429 } +00430 +<a name="l00431"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a23">00431</a> <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> CAgentWatchTimer::runMethodBase(<font class="keywordtype">int</font> heritance, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *o) +00432 { +00433 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a23">runMethodBase</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,o); +00434 } +00435 +<a name="l00436"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a25">00436</a> IObjectIA::CProcessResult CAgentWatchTimer::runMethodeMember(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *o) +00437 { +00438 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a23">runMethodBase</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, o); +00439 } +00440 +<a name="l00441"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a24">00441</a> <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> CAgentWatchTimer::runMethodBase(<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *o) +00442 { +00443 <a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a> = (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *)o; +00444 +00445 <font class="keywordflow">switch</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - CAgentScript::getMethodIndexSize()) +00446 { +00447 <font class="keywordflow">case</font> CAgentWatchTimer::TAttach: +00448 { +00449 CIteratorContener i = param-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_6">getIterator</a>(); +00450 +00451 <font class="keywordflow">if</font>(param-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_12">size</a>()) +00452 { +00453 <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#b0">IConnectIA</a> *call = (<a class="code" href="classNLAIAGENT_1_1IConnectIA.html#b0">IConnectIA</a> *)i++; +00454 call->incRef(); +00455 IMessageBase *msg = (IMessageBase *)i++; +00456 msg->incRef(); +00457 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a12">addAttrib</a>(call,msg); +00458 } +00459 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a13">attach</a>(); +00460 IObjectIA::CProcessResult a; +00461 +00462 a.Result = <font class="keyword">new</font> CAgentTimerHandle(<font class="keyword">this</font>); +00463 <font class="keywordflow">return</font> a; +00464 } +00465 +00466 <font class="keywordflow">case</font> CAgentWatchTimer::TAddAttrib: +00467 { +00468 CIteratorContener i = param-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_6">getIterator</a>(); +00469 <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#b0">IConnectIA</a> *call = (<a class="code" href="classNLAIAGENT_1_1IConnectIA.html#b0">IConnectIA</a> *)i++; +00470 call->incRef(); +00471 IMessageBase *msg = (IMessageBase *)i++; +00472 msg->incRef(); +00473 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a12">addAttrib</a>(call,msg); +00474 IObjectIA::CProcessResult a; +00475 +00476 a.Result = <font class="keyword">new</font> CAgentTimerHandle(<font class="keyword">this</font>); +00477 <font class="keywordflow">return</font> a; +00478 } +00479 +00480 <font class="keywordflow">case</font> CAgentWatchTimer::TSetClock: +00481 { +00482 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a11">setClock</a>( (uint)((<a class="code" href="classNLAIAGENT_1_1INombreDefine.html">NLAIAGENT::INombreDefine</a> *)param-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_10">get</a>())->getNumber() ); +00483 <font class="keywordflow">return</font> <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a>(); +00484 } +00485 <font class="keywordflow">case</font> CAgentWatchTimer::TGetClock: +00486 { +00487 <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>; +00488 r.<a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html#m1">Result</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1DDigitalType.html">NLAIAGENT::DDigitalType</a>((<font class="keywordtype">double</font>)<a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a10">getClock</a>()); +00489 <font class="keywordflow">return</font> r; +00490 } +00491 <font class="keywordflow">default</font>: +00492 <font class="keywordflow">return</font> CAgentScript::runMethodBase(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,o); +00493 } +00494 } +00495 +<a name="l00496"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a26">00496</a> IMessageBase *CAgentWatchTimer::runTell(<font class="keyword">const</font> IMessageBase &m) +00497 { +00498 <font class="keyword">static</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> idMsgKillTimer (<font class="stringliteral">"MsgStopTimer"</font>); +00499 <font class="keyword">static</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> idMsgStartTimer (<font class="stringliteral">"MsgStartTimer"</font>); +00500 <font class="keywordflow">if</font>(m.getType() == idMsgKillTimer) +00501 { +00502 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a4">setState</a>(<a class="code" href="namespaceNLAIAGENT.html#a50a5">processEnd</a>,NULL); +00503 <font class="keywordflow">return</font> NULL; +00504 } +00505 <font class="keywordflow">else</font> +00506 <font class="keywordflow">if</font>(m.getType() == idMsgStartTimer) +00507 { +00508 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a4">setState</a>(<a class="code" href="namespaceNLAIAGENT.html#a50a2">processIdle</a>,NULL); +00509 <font class="keywordflow">return</font> NULL; +00510 } +00511 <font class="keywordflow">else</font> <font class="keywordflow">return</font> CAgentScript::runTell(m); +00512 } +00513 +<a name="l00514"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#p0">00514</a> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a> **CAgentWatchTimer::StaticMethod = NULL; +00515 +<a name="l00516"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#d1">00516</a> <font class="keywordtype">void</font> CAgentWatchTimer::initMsgClass() +00517 { +00518 std::string msgStr; +00519 std::string scriptName(<font class="stringliteral">"MsgTimer"</font>); +00520 msgStr = std::string(<font class="stringliteral">"From Message : Define MsgStopTimer\n{"</font>); +00521 msgStr += std::string(<font class="stringliteral">"Component:\n"</font>); +00522 msgStr += std::string(<font class="stringliteral">"End\n}\n"</font>); +00523 <a class="code" href="namespaceNLAILINK.html#a7">NLAILINK::buildScript</a>(msgStr,scriptName); +00524 msgStr = std::string(<font class="stringliteral">"From Message : Define MsgStartTimer\n{"</font>); +00525 msgStr += std::string(<font class="stringliteral">"Component:\n"</font>); +00526 msgStr += std::string(<font class="stringliteral">"End\n}\n"</font>); +00527 <a class="code" href="namespaceNLAILINK.html#a7">NLAILINK::buildScript</a>(msgStr,scriptName); +00528 } +00529 +<a name="l00530"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#d0">00530</a> <font class="keywordtype">void</font> CAgentWatchTimer::initClass() +00531 { +00532 CAgentTimerHandle::initClass(); +00533 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#d1">initMsgClass</a>(); +00534 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a0">CAgentWatchTimer</a> h; +00535 CAgentWatchTimer::IdAgentWatchTimer = <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> (<font class="stringliteral">"AgentWatchTimer"</font>, <a class="code" href="classNLAIC_1_1CSelfClassFactory.html">NLAIC::CSelfClassFactory</a>((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> &)h), +00536 <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a>(<a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s4">NLAIC::CTypeOfObject::tAgent</a>), +00537 <a class="code" href="classNLAIC_1_1CTypeOfOperator.html">NLAIC::CTypeOfOperator</a>(<a class="code" href="classNLAIC_1_1CTypeOfOperator.html#s15s0">NLAIC::CTypeOfOperator::opNone</a>)); +00538 +00539 <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> *<a class="code" href="namespaceNLAIAGENT.html#a13">Param</a> = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>(1, <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimpleListOr.html">NLAISCRIPT::COperandSimpleListOr</a>(2, +00540 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1DDigitalType.html#p0">NLAIAGENT::DDigitalType::IdDDigitalType</a>), +00541 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1DigitalType.html#p1">NLAIAGENT::DigitalType::IdDigitalType</a>))); +00542 +00543 +00544 CAgentWatchTimer::StaticMethod = <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a> *[CAgentWatchTimer::TLastM]; +00545 +00546 CAgentWatchTimer::StaticMethod[CAgentWatchTimer::TAttach] = +00547 <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a>(<a class="code" href="agent__method__def_8h.html#a11">_ATTACH_</a>, +00548 CAgentWatchTimer::TAttach, +00549 NULL,<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#s26s24">NLAIAGENT::CAgentScript::DoNotCheck</a>, +00550 2, <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a>( <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>( +00551 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(*CAgentTimerHandle::IdAgentTimerHandle)))); +00552 +00553 CAgentWatchTimer::StaticMethod[CAgentWatchTimer::TAddAttrib] = +00554 <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a>(<a class="code" href="agent__method__def_8h.html#a15">_ADDATTRIB_</a>, +00555 CAgentWatchTimer::TAddAttrib, +00556 NULL,<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#s26s23">NLAIAGENT::CAgentScript::CheckCount</a>, +00557 2, <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a>( <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>( +00558 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(*CAgentTimerHandle::IdAgentTimerHandle)))); +00559 +00560 CAgentWatchTimer::StaticMethod[CAgentWatchTimer::TGetClock] = +00561 <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a>(<a class="code" href="agent__method__def_8h.html#a13">_GETCLOCK_</a>, +00562 CAgentWatchTimer::TGetClock, +00563 NULL,<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#s26s23">NLAIAGENT::CAgentScript::CheckCount</a>, +00564 0, <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a>( +00565 <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>( +00566 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1DigitalType.html#p1">NLAIAGENT::DigitalType::IdDigitalType</a>)))); +00567 +00568 CAgentWatchTimer::StaticMethod[CAgentWatchTimer::TSetClock] = +00569 <font class="keyword">new</font> <a class="code" href="structNLAIAGENT_1_1CAgentScript_1_1CMethodCall.html">NLAIAGENT::CAgentScript::CMethodCall</a>(<a class="code" href="agent__method__def_8h.html#a12">_SETCLOCK_</a>, +00570 CAgentWatchTimer::TSetClock, +00571 Param,<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#s26s22">NLAIAGENT::CAgentScript::CheckAll</a>, +00572 1, <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a>( +00573 <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a>( +00574 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1DigitalType.html#p1">NLAIAGENT::DigitalType::IdDigitalType</a>)))); +00575 } +00576 +<a name="l00577"></a><a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#d2">00577</a> <font class="keywordtype">void</font> CAgentWatchTimer::releaseClass() +00578 { +00579 CAgentTimerHandle::releaseClass(); +00580 <font class="keyword">delete</font> CAgentWatchTimer::IdAgentWatchTimer; +00581 <font class="keywordtype">int</font> i; +00582 <font class="keywordflow">for</font>(i = 0; i < CAgentWatchTimer::TLastM; i++) +00583 { +00584 <font class="keyword">delete</font> CAgentWatchTimer::StaticMethod[i]; +00585 } +00586 <font class="keyword">delete</font> CAgentWatchTimer::StaticMethod; +00587 } +00588 +00589 <font class="comment">//##################################</font> +00590 <font class="comment">//CAgentClockTimer</font> +00591 <font class="comment">//##################################</font> +00592 +<a name="l00593"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#p0">00593</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> *CAgentClockTimer::IdAgentClockTimer = NULL; +00594 +<a name="l00595"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a0">00595</a> CAgentClockTimer::CAgentClockTimer():CAgentWatchTimer(), _TimeCount(0) +00596 { +00597 } +00598 +<a name="l00599"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a1">00599</a> CAgentClockTimer::CAgentClockTimer(IAgentManager *m):CAgentWatchTimer(m), _TimeCount(0) +00600 { +00601 } +00602 +<a name="l00603"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a2">00603</a> CAgentClockTimer::CAgentClockTimer(IAgentManager *m, IBasicAgent *a, <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> &<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>, <a class="code" href="classNLAISCRIPT_1_1CAgentClass.html">NLAISCRIPT::CAgentClass</a> *c): +00604 CAgentWatchTimer(m,a,v,c), _TimeCount(0) +00605 { +00606 } +00607 +<a name="l00608"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a3">00608</a> CAgentClockTimer::CAgentClockTimer(<font class="keyword">const</font> CAgentClockTimer &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>):CAgentWatchTimer(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>), _TimeCount(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>._TimeCount) +00609 { +00610 } +00611 +<a name="l00612"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a4">00612</a> CAgentClockTimer::~CAgentClockTimer() +00613 { +00614 } +00615 +<a name="l00616"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a7">00616</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentClockTimer::clone()<font class="keyword"> const</font> +00617 <font class="keyword"> </font>{ +00618 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a0">CAgentClockTimer</a>(*<font class="keyword">this</font>); +00619 } +00620 +<a name="l00621"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a8">00621</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentClockTimer::newInstance()<font class="keyword"> const</font> +00622 <font class="keyword"> </font>{ +00623 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a0">CAgentClockTimer</a>(); +00624 } +00625 +<a name="l00626"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a9">00626</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CAgentClockTimer::getType()<font class="keyword"> const</font> +00627 <font class="keyword"> </font>{ +00628 <font class="keywordflow">return</font> *<a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#p0">IdAgentClockTimer</a>; +00629 } +00630 +<a name="l00631"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a10">00631</a> IObjectIA::CProcessResult CAgentClockTimer::runActivity() +00632 { +00633 <font class="comment">//_Clock -= CAgentManagerTimer::ClockTick;</font> +00634 NLMISC::TTicks time = <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a> () - <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n1">_DTime</a>; +00635 <font class="keywordflow">if</font>((sint) (time) >= <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n0">_Clock</a>) +00636 { +00637 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#a16">tellBroker</a>(); +00638 { +00639 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n0">_Clock</a> = <a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#o0">_TimeCount</a>; +00640 <a class="code" href="classNLAIAGENT_1_1CAgentWatchTimer.html#n1">_DTime</a> = <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a> (); +00641 } +00642 +00643 } +00644 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">getState</a>(); +00645 } +00646 +<a name="l00647"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a5">00647</a> <font class="keywordtype">void</font> CAgentClockTimer::setClock(uint c) +00648 { +00649 <a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#o0">_TimeCount</a> = c; +00650 CAgentWatchTimer::setClock(c); +00651 +00652 } +00653 +<a name="l00654"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#d0">00654</a> <font class="keywordtype">void</font> CAgentClockTimer::initClass() +00655 { +00656 <a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#a0">CAgentClockTimer</a> h; +00657 CAgentClockTimer::IdAgentClockTimer = <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> (<font class="stringliteral">"AgentClockTimer"</font>, <a class="code" href="classNLAIC_1_1CSelfClassFactory.html">NLAIC::CSelfClassFactory</a>((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> &)h), +00658 <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a>(<a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s4">NLAIC::CTypeOfObject::tAgent</a>), +00659 <a class="code" href="classNLAIC_1_1CTypeOfOperator.html">NLAIC::CTypeOfOperator</a>(<a class="code" href="classNLAIC_1_1CTypeOfOperator.html#s15s0">NLAIC::CTypeOfOperator::opNone</a>)); +00660 } +00661 +<a name="l00662"></a><a class="code" href="classNLAIAGENT_1_1CAgentClockTimer.html#d1">00662</a> <font class="keywordtype">void</font> CAgentClockTimer::releaseClass() +00663 { +00664 <font class="keyword">delete</font> CAgentClockTimer::IdAgentClockTimer; +00665 } +00666 +00667 <font class="comment">//##################################</font> +00668 <font class="comment">//CAgentTimerHandle</font> +00669 <font class="comment">//##################################</font> +<a name="l00670"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#p0">00670</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> *CAgentTimerHandle::IdAgentTimerHandle = NULL; +00671 +<a name="l00672"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a0">00672</a> CAgentTimerHandle::CAgentTimerHandle():_Timer (NULL) +00673 { +00674 } +00675 +<a name="l00676"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a1">00676</a> CAgentTimerHandle::CAgentTimerHandle(CAgentWatchTimer *<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>) +00677 { +00678 <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>; +00679 <font class="keywordflow">if</font>(_Timer) <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->incRef(); +00680 } +00681 +<a name="l00682"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a2">00682</a> CAgentTimerHandle::CAgentTimerHandle(<font class="keyword">const</font> CAgentTimerHandle &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>) +00683 { +00684 <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>._Timer; +00685 <font class="keywordflow">if</font>(_Timer) <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->incRef(); +00686 } +00687 +<a name="l00688"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a3">00688</a> CAgentTimerHandle::~CAgentTimerHandle() +00689 { +00690 +00691 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> != NULL) +00692 { +00693 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->getRef() == 1) +00694 { +00695 CVectorGroupType g(1); +00696 std::string <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>; +00697 ((<font class="keyword">const</font> IWordNumRef &)*<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>).getNumIdent().getDebugString(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>); +00698 g.set(0,<font class="keyword">new</font> CStringType(CStringVarName(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>.c_str()))); +00699 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>; +00700 <font class="keywordflow">if</font>(CAgentManagerTimer::TimerManager != NULL) +00701 { +00702 NLMISC::CSynchronized<CAgentScript *>::CAccessor accessor(CAgentManagerTimer::TimerManager); +00703 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = accessor.value()->removeDynamic(&g); +00704 } +00705 <font class="keywordflow">if</font>( ((INombreDefine *)<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result)->getNumber() != 1.0) +00706 <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->release(); +00707 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result->release(); +00708 +00709 } +00710 <font class="keywordflow">else</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->decRef(); +00711 } +00712 } +00713 +00714 +<a name="l00715"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a7">00715</a> <font class="keywordtype">void</font> CAgentTimerHandle::getDebugString(std::string &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>)<font class="keyword"> const</font> +00716 <font class="keyword"> </font>{ +00717 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> != NULL) <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->getDebugString(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>); +00718 } +00719 +<a name="l00720"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a4">00720</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentTimerHandle::clone()<font class="keyword"> const</font> +00721 <font class="keyword"> </font>{ +00722 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a0">CAgentTimerHandle</a>(*<font class="keyword">this</font>); +00723 } +00724 +<a name="l00725"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a5">00725</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CAgentTimerHandle::newInstance()<font class="keyword"> const</font> +00726 <font class="keyword"> </font>{ +00727 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a0">CAgentTimerHandle</a>(); +00728 } +00729 +<a name="l00730"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a11">00730</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">CAgentTimerHandle::isEqual</a>(<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IBasicObjectIA.html">NLAIAGENT::IBasicObjectIA</a> &a)<font class="keyword"> const</font> +00731 <font class="keyword"> </font>{ +00732 <font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a0">CAgentTimerHandle</a> &h = (<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a0">CAgentTimerHandle</a> &)a; +00733 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> == h._Timer; +00734 } +00735 +<a name="l00736"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a6">00736</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CAgentTimerHandle::getType()<font class="keyword"> const</font> +00737 <font class="keyword"> </font>{ +00738 <font class="keywordflow">return</font> *<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#p0">IdAgentTimerHandle</a>; +00739 } +00740 +<a name="l00741"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a12">00741</a> IObjectIA::CProcessResult CAgentTimerHandle::sendMessage(IObjectIA *m) +00742 { +00743 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> != NULL) +00744 { +00745 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->sendMessage(m); +00746 } +00747 <font class="keywordflow">else</font> +00748 { +00749 m->release(); +00750 <font class="keywordflow">return</font> IObjectIA::CProcessResult(); +00751 } +00752 } +00753 +<a name="l00754"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a13">00754</a> sint32 CAgentTimerHandle::getMethodIndexSize()<font class="keyword"> const</font> +00755 <font class="keyword"> </font>{ +00756 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> != NULL) +00757 { +00758 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->getMethodIndexSize(); +00759 } +00760 <font class="keywordflow">else</font> +00761 { +00762 CAgentWatchTimer a; +00763 <font class="keywordflow">return</font> a.getMethodIndexSize(); +00764 } +00765 } +00766 +<a name="l00767"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a14">00767</a> <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> CAgentTimerHandle::isMember(<font class="keyword">const</font> IVarName *h,<font class="keyword">const</font> IVarName *m,<font class="keyword">const</font> IObjectIA &p)<font class="keyword"> const</font> +00768 <font class="keyword"> </font>{ +00769 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a> != NULL) +00770 { +00771 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->isMember(h,m,p); +00772 } +00773 <font class="keywordflow">else</font> +00774 { +00775 CAgentWatchTimer a; +00776 <font class="keywordflow">return</font> a.isMember(h,m,p); +00777 } +00778 } +00779 +<a name="l00780"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a15">00780</a> IObjectIA::CProcessResult CAgentTimerHandle::runMethodeMember(sint32 h, sint32 m, IObjectIA *p) +00781 { +00782 <font class="keywordflow">return</font> IObjectIA::runMethodeMember(h,m,p); +00783 } +<a name="l00784"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a16">00784</a> IObjectIA::CProcessResult CAgentTimerHandle::runMethodeMember(sint32 m,IObjectIA *p) +00785 { +00786 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#o0">_Timer</a>->runMethodeMember(m,p); +00787 } +00788 +<a name="l00789"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a8">00789</a> <font class="keywordtype">void</font> CAgentTimerHandle::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os) {} +<a name="l00790"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a9">00790</a> <font class="keywordtype">void</font> CAgentTimerHandle::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is) {} +00791 +<a name="l00792"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#d0">00792</a> <font class="keywordtype">void</font> CAgentTimerHandle::initClass() +00793 { +00794 CAgentWatchTimer *<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a> = <font class="keyword">new</font> CAgentWatchTimer(); +00795 <a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#a0">CAgentTimerHandle</a> h(<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>); +00796 CAgentTimerHandle::IdAgentTimerHandle = <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> (<font class="stringliteral">"AgentTimerHandle"</font>, <a class="code" href="classNLAIC_1_1CSelfClassFactory.html">NLAIC::CSelfClassFactory</a>((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> &)h), +00797 <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a>(<a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s6">NLAIC::CTypeOfObject::tObject</a>), +00798 <a class="code" href="classNLAIC_1_1CTypeOfOperator.html">NLAIC::CTypeOfOperator</a>(<a class="code" href="classNLAIC_1_1CTypeOfOperator.html#s15s0">NLAIC::CTypeOfOperator::opNone</a>)); +00799 <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>->release(); +00800 +00801 } +00802 +<a name="l00803"></a><a class="code" href="classNLAIAGENT_1_1CAgentTimerHandle.html#d1">00803</a> <font class="keywordtype">void</font> CAgentTimerHandle::releaseClass() +00804 { +00805 <font class="keyword">delete</font> CAgentTimerHandle::IdAgentTimerHandle; +00806 } +00807 } +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |