|
reSIProcate/stack
9694
|
Hoist for template mapping from Mime to derived content. More...
#include <ContentsFactoryBase.hxx>


Public Member Functions | |
| ContentsFactoryBase (const Mime &contentType) | |
| virtual | ~ContentsFactoryBase () |
| virtual Contents * | create (const HeaderFieldValue &hfv, const Mime &contentType) const =0 |
| virtual Contents * | convert (Contents *c) const =0 |
Static Public Member Functions | |
| static HashMap< Mime, ContentsFactoryBase * > & | getFactoryMap () |
Private Attributes | |
| Mime | mContentType |
Static Private Attributes | |
| static HashMap< Mime, ContentsFactoryBase * > * | FactoryMap = 0 |
Hoist for template mapping from Mime to derived content.
Definition at line 16 of file ContentsFactoryBase.hxx.
| ContentsFactoryBase::ContentsFactoryBase | ( | const Mime & | contentType | ) |
Definition at line 11 of file ContentsFactoryBase.cxx.
References getFactoryMap().
: mContentType(contentType) { // .amr. Due to multiple static initializers, this can be called more than once for a mimetype // so gracefully handle it if(ContentsFactoryBase::getFactoryMap().count(contentType) == 0) ContentsFactoryBase::getFactoryMap()[contentType] = this; }

| ContentsFactoryBase::~ContentsFactoryBase | ( | ) | [virtual] |
Definition at line 20 of file ContentsFactoryBase.cxx.
References FactoryMap, getFactoryMap(), and mContentType.
{
if (ContentsFactoryBase::FactoryMap == 0)
return;
HashMap<Mime, ContentsFactoryBase*>::iterator i;
i = ContentsFactoryBase::getFactoryMap().find(mContentType);
// .amr. Need to check if iterator is valid since on some STL instances erase(i) will crash if i is invalid.
if (i != ContentsFactoryBase::getFactoryMap().end())
ContentsFactoryBase::getFactoryMap().erase(i);
if (ContentsFactoryBase::getFactoryMap().size() == 0)
{
delete &ContentsFactoryBase::getFactoryMap();
ContentsFactoryBase::FactoryMap = 0;
}
}

Implemented in resip::ContentsFactory< T >.
| virtual Contents* resip::ContentsFactoryBase::create | ( | const HeaderFieldValue & | hfv, |
| const Mime & | contentType | ||
| ) | const [pure virtual] |
Implemented in resip::ContentsFactory< T >.
| HashMap< Mime, ContentsFactoryBase * > & ContentsFactoryBase::getFactoryMap | ( | ) | [static] |
Definition at line 38 of file ContentsFactoryBase.cxx.
References FactoryMap.
Referenced by ContentsFactoryBase(), resip::Contents::createContents(), resip::SipMessage::getContents(), test7(), and ~ContentsFactoryBase().
{
if (ContentsFactoryBase::FactoryMap == 0)
{
ContentsFactoryBase::FactoryMap = new HashMap<Mime, ContentsFactoryBase*>();
}
return *ContentsFactoryBase::FactoryMap;
}
HashMap< Mime, ContentsFactoryBase * > * ContentsFactoryBase::FactoryMap = 0 [static, private] |
Definition at line 28 of file ContentsFactoryBase.hxx.
Referenced by getFactoryMap(), and ~ContentsFactoryBase().
Mime resip::ContentsFactoryBase::mContentType [private] |
Definition at line 27 of file ContentsFactoryBase.hxx.
Referenced by ~ContentsFactoryBase().
1.7.5.1