473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

scheduling events

Trying a new approach that I think might work out better than my old
approach. And this turns out to be a really good reason for me to learn
boost. Someone else lead me onto this path that I don't fully understand.

So I'm trying to create 10 events that will start from a random amount
of time between now and 10 seconds. I have the random generating code
function that works. And I'm trying to have a scheduler execute my
events at *that* randomly generated time.

I have this at the top of one of my *.cpp files

typedef boost::function<void ()event;

Then here I create the event which I think binds the die function of the
Monster class to this void function called 'killMonster'. What does the
second argument do? This just creates the event and schedules it? Is
this context.scheduler a part of boost or ... where can I find more
about creating a scheduler?

event killMonster = boost::bind(&Monster::die, this -target);
this -context.scheduler.at(NOW + 3.0, killMonster);

Then I have a function that is called between every frame of my game, so
that's where I planned on checking the time of the event to see if it
had expired. Can someone elaborate as to this ... I don't understand how
that fits in with step_length.

time += step_length;
this -context.scheduler.run(time);
Oct 23 '08 #1
0 1363

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something...
7
by: Trevor.D.Matthews | last post by:
I need to develop a scheduling app and am having trouble with the database design. I can easily design a table hold appointments with start and finish times, but I always have an issue when it...
3
by: Alphonse Giambrone | last post by:
Can anyone point me toward a good example of an asp.net scheduling app? Preferrably in vb.net. TIA -- Alphonse Giambrone Email: a-giam at customdatasolutions dot us
2
by: Ivan Demkovitch | last post by:
Hi! If I understand caching properly: 1. Create object in cache and set expiration Time to let's say 1 minute 2. Specify delegate which will be called on object expiration. Here we will...
1
by: Majed | last post by:
hi I'm planing to make scheduling app and need your advice on the best way to do that,and how to save the tasks to be executed and retrive their data at the right time. your input will be highly...
4
by: Tom & Carol Satran | last post by:
Hi I am new to this group and to access. I am trying to make a database for a NFP Youth Organization. We have mutiple home teams, visiting teams, and sites. I have the following in a before...
4
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a...
2
Ritchie
by: Ritchie | last post by:
Please can anyone help me with d programs in C for CPU scheduling: WAP to show FCFS scheduling algorithm. WAP to show SJF scheduling algorithm. WAP to show Priority scheduling algorithm. WAP...
4
by: Cirene | last post by:
I'm designing my db for a online Scheduling web application. How do you suggest I handle reoccuring events? In my appointments table should I just add 1 record for EACH time the appointment...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.