reSIProcate/rutil  9694
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
resip::RRVip Class Reference

#include <RRVip.hxx>

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

List of all members.

Classes

class  HostTransformFactory
class  MapKey
class  NaptrTransform
class  NaptrTransformFactroy
class  SrvTransform
class  SrvTransformFactory
class  Transform
class  TransformFactory

Public Member Functions

 RRVip ()
 ~RRVip ()
void vip (const Data &target, int rrType, const Data &vip)
void removeVip (const Data &target, int rrType)
void transform (const Data &target, int rrType, std::vector< DnsResourceRecord * > &)

Private Types

typedef std::vector
< DnsResourceRecord * > 
RRVector
typedef std::map< int,
TransformFactory * > 
TransformFactoryMap
typedef std::map< MapKey,
Transform * > 
TransformMap

Private Member Functions

 RRVip (const RRVip &)
RRVipoperator= (const RRVip &)

Private Attributes

TransformFactoryMap mFactories
TransformMap mTransforms

Detailed Description

Definition at line 9 of file RRVip.hxx.


Member Typedef Documentation

typedef std::vector<DnsResourceRecord*> resip::RRVip::RRVector [private]

Definition at line 24 of file RRVip.hxx.

typedef std::map<int, TransformFactory*> resip::RRVip::TransformFactoryMap [private]

Definition at line 88 of file RRVip.hxx.

typedef std::map<MapKey, Transform*> resip::RRVip::TransformMap [private]

Definition at line 91 of file RRVip.hxx.


Constructor & Destructor Documentation

RRVip::RRVip ( )

Definition at line 46 of file RRVip.cxx.

References T_A, T_AAAA, T_NAPTR, and T_SRV.

{
   mFactories[T_A] = new HostTransformFactory;
   mFactories[T_AAAA] = new HostTransformFactory;
   mFactories[T_NAPTR] = new NaptrTransformFactroy;
   mFactories[T_SRV] = new SrvTransformFactory;
}
RRVip::~RRVip ( )

Definition at line 54 of file RRVip.cxx.

{
   for (map<MapKey, Transform*>::iterator it = mTransforms.begin(); it != mTransforms.end(); ++it)
   {
      delete (*it).second;
   }

   for (TransformFactoryMap::iterator it = mFactories.begin(); it != mFactories.end(); ++it)
   {
      delete (*it).second;
   }
}
resip::RRVip::RRVip ( const RRVip ) [private]

Member Function Documentation

RRVip& resip::RRVip::operator= ( const RRVip ) [private]
void RRVip::removeVip ( const Data target,
int  rrType 
)

Definition at line 86 of file RRVip.cxx.

References DebugLog.

{
   RRVip::MapKey key(target, rrType);
   TransformMap::iterator it = mTransforms.find(key);
   if (it != mTransforms.end())
   {
      Data vip = it->second->vip();
      delete (*it).second;
      mTransforms.erase(it);
      DebugLog(<< "removed vip " << target << "(" << rrType << "): " << vip);
   }
}
void RRVip::transform ( const Data target,
int  rrType,
std::vector< DnsResourceRecord * > &  src 
)

Definition at line 100 of file RRVip.cxx.

{
   RRVip::MapKey key(target, rrType);
   TransformMap::iterator it = mTransforms.find(key);
   if (it != mTransforms.end())
   {
      bool invalidVip = false;
      it->second->transform(src, invalidVip);
      if (invalidVip) 
      {
         removeVip(target, rrType);
      }
   }
}
void RRVip::vip ( const Data target,
int  rrType,
const Data vip 
)

Definition at line 67 of file RRVip.cxx.

Referenced by resip::RRVip::Transform::transform(), resip::RRVip::NaptrTransform::transform(), resip::RRVip::SrvTransform::transform(), and resip::RRVip::Transform::updateVip().

{
   RRVip::MapKey key(target, rrType);
   TransformMap::iterator it = mTransforms.find(key);
   if (it != mTransforms.end())
   {
      it->second->updateVip(vip);
   }
   else
   {
      TransformFactoryMap::iterator it = mFactories.find(rrType);
      assert(it != mFactories.end());
      Transform* transform = it->second->createTransform(vip);
      mTransforms.insert(TransformMap::value_type(key, transform));
   }
}

Member Data Documentation

Definition at line 89 of file RRVip.hxx.

Definition at line 92 of file RRVip.hxx.


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