Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » extracted Timer from Ctrl
extracted Timer from Ctrl [message #24401] Thu, 14 January 2010 12:28 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi there

i was in need of easy and quick solution for a timer queue, usable without the Ctrl stuff, that said, with Core only. so i extracted timer behaviour from Ctrl and put it in a class, which is running a Thread to work the queue, its really a quick solution, you cant set granularity for now, but this one can be extended.

it has same API as the Ctrl Timer, so one can setup callbacks.

maybe its usable for someone.
greets

Timer: the timer class itself
TimerTest: Test class for timer. really quick, "proof of concept"
Re: extracted Timer from Ctrl [message #24404 is a reply to message #24401] Thu, 14 January 2010 17:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Thu, 14 January 2010 06:28

hi there

i was in need of easy and quick solution for a timer queue, usable without the Ctrl stuff, that said, with Core only. so i extracted timer behaviour from Ctrl and put it in a class, which is running a Thread to work the queue, its really a quick solution, you cant set granularity for now, but this one can be extended.

it has same API as the Ctrl Timer, so one can setup callbacks.

maybe its usable for someone.
greets

Timer: the timer class itself
TimerTest: Test class for timer. really quick, "proof of concept"



Maybe you might want to put it to the bazaar?

Mirek
Re: extracted Timer from Ctrl [message #24405 is a reply to message #24404] Thu, 14 January 2010 20:17 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi mirek
no problem with that..i dont know how to add it there.
i will be on improving it a bit, hope it works out.

is there a general howto for people who think of contributing to upp, how they can do it, what ways they have to do so, what things to take care of, what tools to use, have not found any..

meybe need to start another thread about it, should also be part of documentation, would be definitely good.
Re: extracted Timer from Ctrl [message #24411 is a reply to message #24405] Fri, 15 January 2010 15:10 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
here comes a version with granularity
and i have removed the ASSERT(id) checks, so one can use really a unique id now, and search exactely for it, without constraints of sizeof(Timer) (btw, what was that for mirek? (byte*)sizeof(Ctrl)+id)

  • Attachment: Timer.rar
    (Size: 1.89KB, Downloaded 403 times)
Re: extracted Timer from Ctrl [message #24412 is a reply to message #24405] Fri, 15 January 2010 15:46 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
kohait00 wrote on Thu, 14 January 2010 21:17

hi mirek
no problem with that..i dont know how to add it there.
i will be on improving it a bit, hope it works out.

is there a general howto for people who think of contributing to upp, how they can do it, what ways they have to do so, what things to take care of, what tools to use, have not found any..


A little How To:
Request svn access from Mirek. He will give you write access to bazaar directory from svn repository. Any change you make to bazaar directory will be recorded in repository "history".

Tools needed for that: subversion and theIDE. TheIDE have svn integration, that means you may commit directly from theIDE or if you prefer you may commit from your favourite svn client (svn from CLI, TortoiseSVN, KDESvn, etc.). IIRC theIDE search for svn client in PATH environment variable, there you should put your path to svn client if it's not done automatically by it's installer (in cases when you install from archive).

You should take care to not modify others packages (you may have write access to them, i don't know how rights are distributed in bazaar). When you commit always put a comment about changes.

If your commits are related to U++ core not bazaar you may create patches for your changes and upload them to forum. Mirek will review and accept or reject them.

You may read a tutorial about svn if you want to know a bit deeply how it works.

Andrei
Re: extracted Timer from Ctrl [message #24884 is a reply to message #24412] Wed, 03 February 2010 07:05 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
thank you andrej.

this info should be placed somewhere in the docu, in things like "how to contribute" or similar. because, frankly, patches are placed in wild forms, plain text, diff, source files etc.. good for users, bad for mirek. time consuming. that should be unified a bit, with a short tutorial how to provide patches etc.. diff prefered.. so mirek can actually review things esier.

greets
Re: extracted Timer from Ctrl [message #24886 is a reply to message #24884] Wed, 03 February 2010 08:13 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
kohait00 wrote on Wed, 03 February 2010 07:05

thank you andrej.

this info should be placed somewhere in the docu, in things like "how to contribute" or similar. because, frankly, patches are placed in wild forms, plain text, diff, source files etc.. good for users, bad for mirek. time consuming. that should be unified a bit, with a short tutorial how to provide patches etc.. diff prefered.. so mirek can actually review things esier.

greets

Hello Mirek

Answering kohait comments, this: http://www.ultimatepp.org/www$uppweb$bazaar_support$en-us.ht ml is included in Bazaar, but this or something similar could be in main web pages:

Perhaps some new page linked from manual page: http://www.ultimatepp.org/www$uppweb$documentation$en-us.htm l

If you agree and do not have time to do it I can.


Best regards
Iñaki
Re: extracted Timer from Ctrl [message #24902 is a reply to message #24886] Wed, 03 February 2010 17:27 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hey this is good...
some short and simple instructions..
the only thing maybe missing is the "how to become a svn contributor/comitter"

Re: extracted Timer from Ctrl [message #24908 is a reply to message #24902] Wed, 03 February 2010 21:14 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
kohait00 wrote on Wed, 03 February 2010 17:27

hey this is good...
some short and simple instructions..
the only thing maybe missing is the "how to become a svn contributor/comitter"



Hello Kohait

... in Bazaar there is this Smile : http://www.ultimatepp.org/www$uppweb$bazaar_submission$en-us .html

As in the other post, perhaps something similar could be put in main web.

And as in the other post, if nobody can do it I can Smile.


Best regards
Iñaki
Re: extracted Timer from Ctrl [message #25285 is a reply to message #24908] Tue, 16 February 2010 14:12 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
great again. this should be really part of Manual, BTW the Manual seems to be bricked..most is missing..

you could push the Timer to the bazaar, since i dont think svn for me is really needed..

here is my current workiing release..it has not had changes, as far as i remember

thanks

EDIT:

why not making the Ctrl timer general anyway? so Ctrl simply *uses* a timer, defined anywhere, but the Timer is not dependant to it...
  • Attachment: Timer.zip
    (Size: 2.08KB, Downloaded 388 times)
  • Attachment: TimerTest.zip
    (Size: 1.42KB, Downloaded 577 times)

[Updated on: Tue, 16 February 2010 15:59]

Report message to a moderator

Re: extracted Timer from Ctrl [message #25313 is a reply to message #25285] Tue, 16 February 2010 22:50 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
kohait00 wrote on Tue, 16 February 2010 14:12

great again. this should be really part of Manual, BTW the Manual seems to be bricked..most is missing..

you could push the Timer to the bazaar, since i dont think svn for me is really needed..

here is my current workiing release..it has not had changes, as far as i remember

thanks

EDIT:

why not making the Ctrl timer general anyway? so Ctrl simply *uses* a timer, defined anywhere, but the Timer is not dependant to it...

Hello kohait00

If you maintain it and give some documentation, at least as text Smile , I will upload it to svn.


Best regards
Iñaki
Re: extracted Timer from Ctrl [message #25323 is a reply to message #25313] Wed, 17 February 2010 09:32 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
i can do some maitanance.. concerning documentation, there isn't actually that much.

1) The Interface is the same as used from the Ctrl::TimerCallback in CtrlCore

2) To use it one does *not* need CtrlCore anymore, simply Core and Timer, where the application has a Timer instance.

3) should keep in mind, that it's a timer *queue* other things wont get to execution, until a current task is finished, and the timer queue can check whether time has come for the next task.

4) because of 3), the timing is not as accurate as maybe desired and can have "timer glitches/jitter", depending on work load..

5) favorite use is to schedule some *non*-timing-critical work for "somwhere-around-in-the-future".

6) for timing critical stuff, consider using OS native timer means, for WIN32 SetTimer (in windowing environment, using WM_TIMER callback) or CreateWaitableTimer for windowing-independant stuff, or even QueryPerformanceCounter. for Linux/Unix/Posix settimer function, but for linux there is a lot anyway.

thats basicly all
Re: extracted Timer from Ctrl [message #25380 is a reply to message #25323] Sat, 20 February 2010 00:44 Go to previous message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
kohait00 wrote on Wed, 17 February 2010 09:32

i can do some maitanance.. concerning documentation, there isn't actually that much.

1) The Interface is the same as used from the Ctrl::TimerCallback in CtrlCore

2) To use it one does *not* need CtrlCore anymore, simply Core and Timer, where the application has a Timer instance.

3) should keep in mind, that it's a timer *queue* other things wont get to execution, until a current task is finished, and the timer queue can check whether time has come for the next task.

4) because of 3), the timing is not as accurate as maybe desired and can have "timer glitches/jitter", depending on work load..

5) favorite use is to schedule some *non*-timing-critical work for "somwhere-around-in-the-future".

6) for timing critical stuff, consider using OS native timer means, for WIN32 SetTimer (in windowing environment, using WM_TIMER callback) or CreateWaitableTimer for windowing-independant stuff, or even QueryPerformanceCounter. for Linux/Unix/Posix settimer function, but for linux there is a lot anyway.

thats basicly all


Hello Kohait

Now it is included in Bazaar Smile


Best regards
Iñaki
Previous Topic: Virtual functions versus callbacks
Next Topic: PostCallback executes 2 at once?
Goto Forum:
  


Current Time: Thu Mar 28 10:41:06 CET 2024

Total time taken to generate the page: 0.01457 seconds