reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
IntrusiveListElement.hxx File Reference

Heritable intrusive doubly linked list element templates. More...

Go to the source code of this file.

Classes

class  resip::IntrusiveListElement< P >
 
class  resip::IntrusiveListElement< P >::iterator
 
class  resip::IntrusiveListElement1< P >
 
class  resip::IntrusiveListElement1< P >::iterator
 
class  resip::IntrusiveListElement2< P >
 
class  resip::IntrusiveListElement2< P >::iterator
 
class  resip::IntrusiveListElement3< P >
 
class  resip::IntrusiveListElement3< P >::iterator
 

Namespaces

namespace  resip
 dcm! – add UnusedChecking(_enum) below;
 

Detailed Description

Heritable intrusive doubly linked list element templates.

For a class that is an element in a single list, use like this:

class Foo : public IntrusiveListElement<Foo*>
{
...
};
Foo* fooHead = new Foo();
// initialize head to cycle -- represent an empty list
Foo::makeList(fooHead);
void list()
Definition userAdmin.cxx:66

For a class that is an element of multiple lists, use like this: has two independent intrusive lists, named read and write

class FooFoo : public IntrusiveListElement<FooFoo*>, public IntrusiveListElement1<FooFoo*>
{
public:
...
};
// initialize head to cycle -- represent two empty lists
FooFoo::read::makeList(fooFooHead);
FooFoo::write::makeList(fooFooHead);
for (FooFoo::read::iterator f = fooFooHead->read::begin(); f != fooFooHead->read::end(); f++)
{
...
};
// elsewhere:
FooFoo::read* mReadHead = FooFoo::read::makeList(&head);
FooFoo::write* mWriteHead = FooFoo::write::makeList(&head);
// don't need to disambiguate methods
mReadHead->push_back(element);
mWriteHead->push_back(element);
// element could be in either list, so use aspect
element->write::remove();

Definition in file IntrusiveListElement.hxx.