chore: initial commit

This commit is contained in:
fallenoak 2023-01-02 13:17:18 -06:00
commit 70b00c5c38
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
965 changed files with 264882 additions and 0 deletions

37
src/net/grunt/Timer.hpp Normal file
View file

@ -0,0 +1,37 @@
#ifndef NET_GRUNT_TIMER_HPP
#define NET_GRUNT_TIMER_HPP
#include "net/grunt/Grunt.hpp"
#include "storm/List.hpp"
#include "storm/Thread.hpp"
class Grunt::Timer {
public:
// Types
class Event {
public:
// Member variables
TSLink<Event> m_link;
uint32_t m_schedTime;
uint32_t m_interval;
// Virtual methods
virtual void Call() = 0;
};
// Static functions
static uint32_t ThreadProc(void* param);
// Member variables
SEvent m_event = SEvent(0, 0);
SThread m_thread;
SCritSect m_critSect;
STORM_EXPLICIT_LIST(Event, m_link) m_eventList;
// Member functions
Timer();
void Insert(Event&);
uint32_t Pump();
};
#endif