diff --git a/src/eitd/eitd.h b/src/eitd/eitd.h new file mode 100644 index 000000000..1024c9582 --- /dev/null +++ b/src/eitd/eitd.h @@ -0,0 +1,74 @@ +// +// sectionsd.cpp (network daemon for SI-sections) +// (dbox-II-project) +// +// Copyright (C) 2001 by fnbrd +// +// Homepage: http://dbox2.elxsi.de +// +// Copyright (C) 2008, 2009 Stefan Seyfried +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// + +#ifndef __eitd_h__ +#define __eitd_h__ + +#include "SIutils.hpp" +#include "SIservices.hpp" +#include "SIevents.hpp" +#include "SIsections.hpp" +#include "SIlanguage.hpp" + +#include + +typedef boost::shared_ptr SIeventPtr; + +struct OrderServiceUniqueKeyFirstStartTimeEventUniqueKey +{ + bool operator()(const SIeventPtr &p1, const SIeventPtr &p2) + { + return + (p1->get_channel_id() == p2->get_channel_id()) ? + (p1->times.begin()->startzeit == p2->times.begin()->startzeit ? p1->eventID < p2->eventID : p1->times.begin()->startzeit < p2->times.begin()->startzeit ) + : + (p1->get_channel_id() < p2->get_channel_id()); + } +}; + +typedef std::set MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey; + +struct OrderFirstEndTimeServiceIDEventUniqueKey +{ + bool operator()(const SIeventPtr &p1, const SIeventPtr &p2) + { + return + p1->times.begin()->startzeit + (long)p1->times.begin()->dauer == p2->times.begin()->startzeit + (long)p2->times.begin()->dauer ? + (p1->service_id == p2->service_id ? p1->uniqueKey() > p2->uniqueKey() : p1->service_id < p2->service_id) + : + ( p1->times.begin()->startzeit + (long)p1->times.begin()->dauer < p2->times.begin()->startzeit + (long)p2->times.begin()->dauer ) ; + } +}; + +typedef std::set MySIeventsOrderFirstEndTimeServiceIDEventUniqueKey; + +typedef std::map > MySIeventUniqueKeysMetaOrderServiceUniqueKey; +typedef std::map > MySIeventsOrderUniqueKey; + +typedef boost::shared_ptr SIservicePtr; +typedef std::map > MySIservicesOrderUniqueKey; +typedef std::map > MySIservicesNVODorderUniqueKey; + +#endif