Projekt

Allgemein

Profil

Feature #586

Von Maximilian Seesslen vor etwa 2 Monaten aktualisiert

Would be nice to have an automated way for eventLoop handling.

<pre><code class="cpp">
class CEventLoop
{
private:
static CEventLoop* m_first;
CEventLoop* m_next=nullptr;

public:
CEventLoop()
{
if(!m_first)
{
m_first=this;
}
else
{
CEventLoop* p=m_first;
while( p->m_next)
{
p=p->m_next;
}
p->m_next=this;
}
}
virtual void eventLoop()
{
printf("L %p\n", this);
}
static void allEventLoops()
{
CEventLoop* p=m_first;
while(p)
{
p->eventLoop();
p=p->m_next;
}
}
};

CEventLoop* CEventLoop::m_first = nullptr;
</code></pre>

The (RAM) size on an AMD64 is 16 Bytes having 2 pointers. On ARM it will be 8 Bytes.


Zurück