Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

TimerNode.cpp

Go to the documentation of this file.
00001 #include "headers.h"
00002 
00011 TimerNode::TimerNode(void* (*func)(void*), void* arg, TimeValue wakeup, bool* set) {
00012         this->m_arg = arg;
00013         this->m_func = func;
00014         this->m_wakeup = wakeup;
00015         this->m_isValid = set;
00016 } // ctor
00017 
00018 
00022 void
00023 TimerNode::toStream(std::ostream& out)
00024 {
00025     out << " Wakeup: " << m_wakeup;
00026     out << "IsValid: " << boolToString(*m_isValid) << "\n";
00027 } // fn toStream
00028 
00029 
00034 bool TimerNode::past() {
00035     if (TimeValue::getCurrentTime() < m_wakeup) {
00036         return false;
00037     }
00038     else {
00039             return true;
00040     }
00041 } // fn past
00042 
00043 
00047 void* TimerNode::getArg() {
00048         return m_arg;
00049 } // fn getArg
00050 
00051 
00052 /*
00053  * This is the most screwed up function declaration I have ever written.
00054  * This says I am returning a pointer to a function that returns void*, and takes void* as an argument.
00055  */
00056 void* (*TimerNode::getFunc())(void*) {
00057         return m_func;
00058 } // fn getFunc
00059 
00060 
00064 TimeValue TimerNode::getWakeup() {
00065         return m_wakeup;
00066 } //fn getWakeup
00067 
00068 
00072 bool TimerNode::isValid() {
00073         return *m_isValid;
00074 } // fn isValid
00075 
00076 
00080 bool operator <(const TimerNode& node1, const TimerNode& node2) {
00081         if (node1.m_wakeup < node2.m_wakeup) {
00082                 return true;
00083         }
00084         else {
00085                 return false;
00086         }
00087 } // operator <
00088 
00089 

Generated at Thu Jul 11 13:31:52 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001