1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: DBs and Events -->
<!--X-From-R13: f001tzhNabin.jevtug.rqh -->
<!--X-Date: Wed, 11 Feb 1998 14:26:09 +0000 -->
<!--X-Message-Id: Pine.PMDF.3.95.980211090921.543348537A&#45;100000#nova,wright.edu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.3.91.980210211015.65K&#45;100000@uni&#45;corn.demon.co.uk -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, DBs and Events</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:s001gmu#nova,wright.edu">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00399.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00401.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00399.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00432.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00400">Author</A>
&nbsp;|&nbsp;<A HREF="#00400">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00400">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>DBs and Events</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: DBs and Events</LI>
<LI><em>From</em>: <A HREF="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</A></LI>
<LI><em>Date</em>: Wed, 11 Feb 1998 09:26:16 -0500 (EST)</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>


On Wed, 11 Feb 1998, Greg Munt wrote:

&gt; On Tue, 10 Feb 1998, Nathan Yospe wrote:
&gt; 
&gt; &gt; On Tue, 10 Feb 1998, Greg Munt wrote:

[caching etc...]
 
&gt; &gt; :Any references to Event Management? Is there any alternative to using a 
&gt; &gt; :pointer to a function, to store the Event-&gt;function()? (This has the 
&gt; &gt; :disadvantage of every Event-&gt;function() needing to have the same number 
&gt; &gt; :and type of parameters being passed to it.)
&gt; &gt; 
&gt; &gt; Here we go. This I can help you with. Events don't have to be functions,
&gt; &gt; for a start. An event could be stored as anything, from a script on down
&gt; &gt; to a held thread. I store mine as classes... any action is executed from
&gt; &gt; an event class, which grabs the nearest available execution thread, sets
&gt; &gt; it to the event's references, and frees it to go. Events are, by design,
&gt; &gt; only actually capable of grabbing one specific thread, such that any set
&gt; &gt; of events cannot execute asynchronously on the same resources. Functions
&gt; &gt; are actually pulled up _after_ execution begins... Event.Process() is at
&gt; &gt; its basis a normalization check, which tries to match a list of objects,
&gt; &gt; and upon success, changes the values of the objects to a new norm, then,
&gt; &gt; with its still-active thread, allows those objects to update. The object
&gt; &gt; update methods are the actual functions involved, and once each object's
&gt; &gt; updates are complete (and affected objects with zero delay complete such
&gt; &gt; updates as the modified objects have made available) the thread is wiped
&gt; &gt; clear of variables, set to sleep, and returned to the pool. 
&gt; 
&gt; I'm not sure I understand this too well. Are you suggesting this?
&gt; 
&gt; class Event
&gt;   {
&gt;      private:
&gt;        DataType1 *a;
&gt;        DataType2 *b;
&gt;        ...
&gt; 
&gt;      public:
&gt;        ...
&gt;        process();
&gt;   };

I don't do things exactly the same way as Nathan, but my approach is
pretty similar.  Events work pretty well when done as Classes, I think.
 
&gt; I still can't see how the event isn't a function. The tasks that the 
&gt; event does have to be stored in a function?

well, when you get down to it, what the event does HAS to be in a function
somewhere.  What he was saying (I believe), is that you don't necessarily
have to have a struct with a function pointer in it, limiting the type of
functions that can be assigned.
Classes are not really much different, but because of data encapsulation
it's a lot cleaner to get around the limit on the # of paramaters to the
event handling function.

&gt; Am I wrong in thinking that the data that an Event needs (eg pointer to a 
&gt; Player) are stored in the class, with a function - which takes no 
&gt; parameters - calling class methods to do whatever it is that the Event is 
&gt; trying to achieve? Also, it looks like Event would need to be a template. 
&gt; Forget that, am using Linux g++ :(

you are correct in assuming that all relevent data should be stored in
the event class.  You are incorrect in assuming that the event class has
to be a template class.  I suppose you could do it that way, but I think
it'd be a lot cleaner if you just descend a bunch of event sub-classes
from the base event class.  Each sub-class would have a different set of
variables, and it's own version of the event.process() method.  The event
driver only need know about a very limited subset (if not just one) of the
event classes.

what's wrong with linux g++, as far as templates go, btw?
haven't had a need for a template class yet, but then I'm not very far
into things.  :)
 
&gt; I'm free of Cobol now! Hurrah!

heh.  I've never touched COBOL, and if I can help it, I never will.  :)

-Greg


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00432" HREF="msg00432.html">OT: Linux g++</A></strong>
<ul compact><li><em>From:</em> Greg Munt &lt;greg#uni-corn,demon.co.uk&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00399" HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></STRONG>
<UL><LI><EM>From:</EM> Greg Munt &lt;greg#uni-corn,demon.co.uk&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00401.html">META: Unsubscribed users dur to bounces</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00432.html">OT: Linux g++</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00400"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00400"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>No Subject</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00905" HREF="msg00905.html">No Subject</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 26 Mar 1998, 17:32 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00396" HREF="msg00396.html">DBs and Events</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Tue 10 Feb 1998, 18:30 GMT
<UL>
<LI><strong><A NAME="00397" HREF="msg00397.html">Re: [MUD-Dev]  DBs and Events</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Tue 10 Feb 1998, 19:40 GMT
<UL>
<LI><strong><A NAME="00399" HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Wed 11 Feb 1998, 10:50 GMT
<UL>
<LI><strong><A NAME="00400" HREF="msg00400.html">DBs and Events</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Wed 11 Feb 1998, 14:26 GMT
<UL>
<LI><strong><A NAME="00432" HREF="msg00432.html">OT: Linux g++</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Thu 12 Feb 1998, 11:52 GMT
<UL>
<LI><strong><A NAME="00444" HREF="msg00444.html">Re: [MUD-Dev]  OT: Linux g++</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Fri 13 Feb 1998, 00:30 GMT
<UL>
<LI><strong><A NAME="00487" HREF="msg00487.html">Re: [MUD-Dev]  OT: Linux g++</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Mon 16 Feb 1998, 11:29 GMT
<UL>
<LI><strong><A NAME="00526" HREF="msg00526.html">Re: [MUD-Dev]  OT: Linux g++</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Wed 18 Feb 1998, 17:02 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>