signals 2.0

This commit is contained in:
swaits committed 2010-10-02 22:08:50 -07:00
1 parent b849d8c7ce
commit ef1b465179
33 files changed
+537

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
#include "slot_base.h"
bool slot_base::data_container::operator== (const slot_base::data_container& other) const
{
// TODO: should use memcmp or equivalent
// do a bytewise comparison
for (int i=0;i<SIZE_IN_WORDS;++i)
{
if ( this->data[i] != other.data[i] )
{
return false;
}
}
// must be a perfect match
return true;
}
void slot_base::data_container::zero()
{
// do a bytewise zeroing
for (int i=0;i<SIZE_IN_WORDS;++i)
{
this->data[i] = 0;
}
}
slot_base::slot_base ()
{
for (int i=0;i<NUM_DATA_ITEMS;++i)
{
data[i].zero();
}
}
slot_base::~slot_base ()
{
// empty
}
bool slot_base::operator== (const slot_base& other) const
{
// check each data item for inequality
for (int i=0;i<NUM_DATA_ITEMS;++i)
{
if ( !(this->data[i] == other.data[i]) )
return false;
}
// all data matched
return true;
}