14#ifndef CINTERVALMANAGER_H
15#define CINTERVALMANAGER_H
39class EXPCL_DIRECT_INTERVAL CIntervalManager {
61 void output(std::ostream &out)
const;
62 void write(std::ostream &out)
const;
67 void finish_interval(
CInterval *interval);
68 void remove_index(
int index);
72 F_meta_interval = 0x0002,
80 typedef pvector<IntervalDef> Intervals;
82 typedef pmap<std::string, int> NameIndex;
83 NameIndex _name_index;
84 typedef vector_int Removed;
89 int _next_event_index;
93 static CIntervalManager *_global_ptr;
96INLINE std::ostream &operator << (std::ostream &out,
const CInterval &ival_mgr);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int find_c_interval(const std::string &name) const
Returns the index associated with the named interval, if there is such an interval,...
int get_next_event()
This should be called by the scripting language after each call to step().
void remove_c_interval(int index)
Removes the indicated interval from the queue immediately.
int get_num_intervals() const
Returns the number of currently active intervals.
void step()
This should be called every frame to do the processing for all the active intervals.
int interrupt()
Pauses or finishes (removes from the active queue) all intervals tagged with auto_pause or auto_finis...
void set_event_queue(EventQueue *event_queue)
Specifies a custom event queue to be used for throwing done events from intervals as they finish.
static CIntervalManager * get_global_ptr()
Returns the pointer to the one global CIntervalManager object.
CInterval * get_c_interval(int index) const
Returns the interval associated with the given index.
int get_max_index() const
Returns one more than the largest interval index number in the manager.
int get_next_removal()
This should be called by the scripting language after each call to step().
EventQueue * get_event_queue() const
Returns the custom event queue to be used for throwing done events from intervals as they finish.
int add_c_interval(CInterval *interval, bool external)
Adds the interval to the manager, and returns a unique index for the interval.
The base class for timeline components.
A queue of pending events.
A standard mutex, or mutual exclusion lock.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.