struct uniqueEPGKey
{
int sid, onid, tsid;
uniqueEPGKey( const eServiceReferenceDVB &ref )
:sid( ref.type != eServiceReference::idInvalid ? ref.getServiceID().get() : -1 )
,onid( ref.type != eServiceReference::idInvalid ? ref.getOriginalNetworkID().get() : -1 )
,tsid( ref.type != eServiceReference::idInvalid ? ref.getTransportStreamID().get() : -1 )
{
}
uniqueEPGKey()
:sid(-1), onid(-1), tsid(-1)
{
}
uniqueEPGKey( int sid, int onid, int tsid )
:sid(sid), onid(onid), tsid(tsid)
{
}
bool operator <(const uniqueEPGKey &a) const
{
return memcmp( &sid, &a.sid, sizeof(int)*3)<0;
}
operator bool() const
{
return !(sid == -1 && onid == -1 && tsid == -1);
}
bool operator==(const uniqueEPGKey &a) const
{
return !memcmp( &sid, &a.sid, sizeof(int)*3);
}
struct equal
{
bool operator()(const uniqueEPGKey &a, const uniqueEPGKey &b) const
{
return !memcmp( &a.sid, &b.sid, sizeof(int)*3);
}
};
};