|
SASC-NG
DVBSoftCAM
|
#include <tools.h>
Inheritance diagram for cListBase:Public Member Functions | |
| virtual | ~cListBase () |
| void | Add (cListObject *Object, cListObject *After=NULL) |
| void | Ins (cListObject *Object, cListObject *Before=NULL) |
| void | Del (cListObject *Object, bool DeleteObject=true) |
| virtual void | Move (int From, int To) |
| void | Move (cListObject *From, cListObject *To) |
| virtual void | Clear (void) |
| cListObject * | Get (int Index) const |
| int | Count (void) const |
| void | Sort (void) |
Protected Member Functions | |
| cListBase (void) | |
Protected Attributes | |
| cListObject * | objects |
| cListObject * | lastObject |
| int | count |
| cListBase::cListBase | ( | void | ) | [protected] |
Definition at line 955 of file tools.cpp.
References count, lastObject, NULL, and objects.
{
objects = lastObject = NULL;
count = 0;
}
| cListBase::~cListBase | ( | ) | [virtual] |
| void cListBase::Add | ( | cListObject * | Object, |
| cListObject * | After = NULL |
||
| ) |
Definition at line 966 of file tools.cpp.
References cListObject::Append(), count, cListObject::Insert(), lastObject, cListObject::Next(), and objects.
Referenced by cHashBase::Add(), cConfig< cTimer >::Load(), process_cam(), and Sort().
{
if (After && After != lastObject) {
After->Next()->Insert(Object);
After->Append(Object);
}
else {
if (lastObject)
lastObject->Append(Object);
else
objects = Object;
lastObject = Object;
}
count++;
}
| void cListBase::Clear | ( | void | ) | [virtual] |
Reimplemented in cOsdMenu, and cSkins.
Definition at line 1039 of file tools.cpp.
References count, lastObject, cListObject::Next(), NULL, and objects.
Referenced by ~cListBase().
{
while (objects) {
cListObject *object = objects->Next();
delete objects;
objects = object;
}
objects = lastObject = NULL;
count = 0;
}
| int cListBase::Count | ( | void | ) | const [inline] |
| void cListBase::Del | ( | cListObject * | Object, |
| bool | DeleteObject = true |
||
| ) |
Definition at line 998 of file tools.cpp.
References count, lastObject, cListObject::Next(), objects, cListObject::Prev(), and cListObject::Unlink().
Referenced by cHashBase::Del(), and process_cam().
{
if (Object == objects)
objects = Object->Next();
if (Object == lastObject)
lastObject = Object->Prev();
Object->Unlink();
if (DeleteObject)
delete Object;
count--;
}
| cListObject * cListBase::Get | ( | int | Index | ) | const |
Reimplemented in cList< T >, cList< cHashObject >, cList< cSource >, cList< cKeyMacro >, cList< cOsdItem >, cList< cLinkChannel >, cList< cSetupLine >, cList< cFilterData >, cList< cDll >, cList< cSVDRPhost >, cList< cEvent >, cList< cRemote >, cList< cCommand >, cList< cSkin >, cList< cChannel >, cList< cRecording >, cList< cChannelCamRelation >, cList< cStatus >, cList< cKey >, cList< cFilterHandle >, cList< cFilter >, cList< cMark >, cList< cTimer >, cList< cCamSlot >, cList< cCiCaProgramData >, and cList< cSchedule >.
Definition at line 1050 of file tools.cpp.
References cListObject::Next(), NULL, and objects.
Referenced by cList< cSchedule >::Get(), and Move().
{
if (Index < 0)
return NULL;
cListObject *object = objects;
while (object && Index-- > 0)
object = object->Next();
return object;
}
| void cListBase::Ins | ( | cListObject * | Object, |
| cListObject * | Before = NULL |
||
| ) |
Definition at line 982 of file tools.cpp.
References cListObject::Append(), count, cListObject::Insert(), lastObject, objects, and cListObject::Prev().
| void cListBase::Move | ( | int | From, |
| int | To | ||
| ) | [virtual] |
| void cListBase::Move | ( | cListObject * | From, |
| cListObject * | To | ||
| ) |
Definition at line 1015 of file tools.cpp.
References cListObject::Append(), cListObject::Index(), lastObject, cListObject::Next(), objects, cListObject::Prev(), and cListObject::Unlink().
{
if (From && To) {
if (From->Index() < To->Index())
To = To->Next();
if (From == objects)
objects = From->Next();
if (From == lastObject)
lastObject = From->Prev();
From->Unlink();
if (To) {
if (To->Prev())
To->Prev()->Append(From);
From->Append(To);
}
else {
lastObject->Append(From);
lastObject = From;
}
if (!From->Prev())
objects = From;
}
}
| void cListBase::Sort | ( | void | ) |
Reimplemented in cMarks.
Definition at line 1067 of file tools.cpp.
References Add(), CompareListObjects(), count, Count(), i, lastObject, cListObject::Next(), NULL, objects, and cListObject::Unlink().
{
int n = Count();
cListObject *a[n];
cListObject *object = objects;
int i = 0;
while (object && i < n) {
a[i++] = object;
object = object->Next();
}
qsort(a, n, sizeof(cListObject *), CompareListObjects);
objects = lastObject = NULL;
for (i = 0; i < n; i++) {
a[i]->Unlink();
count--;
Add(a[i]);
}
}
int cListBase::count [protected] |
cListObject * cListBase::lastObject [protected] |
cListObject* cListBase::objects [protected] |