reSIProcate/stack  9694
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
resip::ContentsFactoryBase Class Reference

Hoist for template mapping from Mime to derived content. More...

#include <ContentsFactoryBase.hxx>

Inheritance diagram for resip::ContentsFactoryBase:
Inheritance graph
[legend]
Collaboration diagram for resip::ContentsFactoryBase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ContentsFactoryBase (const Mime &contentType)
virtual ~ContentsFactoryBase ()
virtual Contentscreate (const HeaderFieldValue &hfv, const Mime &contentType) const =0
virtual Contentsconvert (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

Detailed Description

Hoist for template mapping from Mime to derived content.

Definition at line 16 of file ContentsFactoryBase.hxx.


Constructor & Destructor Documentation

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;
}

Here is the call graph for this function:

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;
   }
}

Here is the call graph for this function:


Member Function Documentation

virtual Contents* resip::ContentsFactoryBase::convert ( Contents c) const [pure virtual]

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]

Member Data Documentation

Definition at line 28 of file ContentsFactoryBase.hxx.

Referenced by getFactoryMap(), and ~ContentsFactoryBase().

Definition at line 27 of file ContentsFactoryBase.hxx.

Referenced by ~ContentsFactoryBase().


The documentation for this class was generated from the following files: