Nested class or not nested class?

Posted by eriks on Stack Overflow See other posts from Stack Overflow or by eriks
Published on 2010-03-13T19:52:33Z Indexed on 2010/03/13 19:55 UTC
Read the original article Hit count: 643

Filed under:
|
|

I have class A and list of A objects. A has a function f that should be executed every X seconds (for the first instance every 1 second, for the seconds instance every 5 seconds, etc.). I have a scheduler class that is responsible to execute the functions at the correct time. What i thought to do is to create a new class, ATime, that will hold ptr to A instance and the time A::f should be executed. The scheduler will hold a min priority queue of Atime.

  1. Do you think it is the correct implementation?
  2. Should ATime be a nested class of the scheduler?

© Stack Overflow or respective owner

Related posts about c++

Related posts about nested-class