Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Protected Attributes | Private Member Functions
ArcSec::ArcAttributeFactory Class Reference

Attribute factory class for Arc specified attributes. More...

#include <ArcAttributeFactory.h>

Inheritance diagram for ArcSec::ArcAttributeFactory:
Inheritance graph
[legend]
Collaboration diagram for ArcSec::ArcAttributeFactory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ArcAttributeFactory ()
virtual ~ArcAttributeFactory ()
virtual AttributeValuecreateValue (const Arc::XMLNode &node, const std::string &type)
 creat a AttributeValue according to the value in the XML node and the type; It should be the caller to release the AttributeValue Object

Protected Attributes

AttrProxyMap apmap

Private Member Functions

void initDatatypes ()

Detailed Description

Attribute factory class for Arc specified attributes.

Definition at line 13 of file ArcAttributeFactory.h.


Constructor & Destructor Documentation

Definition at line 47 of file ArcAttributeFactory.cpp.

                                        {
  initDatatypes();
}

Definition at line 64 of file ArcAttributeFactory.cpp.

                                         {
  AttrProxyMap::iterator it;
  for(it = apmap.begin(); it != apmap.end(); it = apmap.begin()){
    AttributeProxy* attrproxy = (*it).second;
    apmap.erase(it);
    if(attrproxy) delete attrproxy;
  }
}

Member Function Documentation

AttributeValue * ArcSec::ArcAttributeFactory::createValue ( const Arc::XMLNode node,
const std::string &  type 
) [virtual]

creat a AttributeValue according to the value in the XML node and the type; It should be the caller to release the AttributeValue Object

Implements ArcSec::AttributeFactory.

Definition at line 51 of file ArcAttributeFactory.cpp.

                                                                                          {
  AttrProxyMap::iterator it;
  if((it=apmap.find(type)) != apmap.end())
    return ((*it).second)->getAttribute(node);
  // This may look like hack, but generic attribute needs special treatment
  GenericAttribute* attr = new GenericAttribute(
          (std::string)const_cast<XMLNode&>(node),
          (std::string)(const_cast<XMLNode&>(node).Attribute("AttributeId")));
  attr->setType(type);
  return attr;
  // return NULL;
}

Here is the call graph for this function:

TODO: other datatype.............

Definition at line 31 of file ArcAttributeFactory.cpp.

                                       {
  //Some Arc specified attribute types
  apmap.insert(std::pair<std::string, AttributeProxy*>(StringAttribute::getIdentifier(), new ArcAttributeProxy<StringAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(DateTimeAttribute::getIdentifier(), new ArcAttributeProxy<DateTimeAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(DateAttribute::getIdentifier(), new ArcAttributeProxy<DateAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(TimeAttribute::getIdentifier(), new ArcAttributeProxy<TimeAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(DurationAttribute::getIdentifier(), new ArcAttributeProxy<DurationAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(PeriodAttribute::getIdentifier(), new ArcAttributeProxy<PeriodAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(X500NameAttribute::getIdentifier(), new ArcAttributeProxy<X500NameAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(AnyURIAttribute::getIdentifier(), new ArcAttributeProxy<AnyURIAttribute>));
  apmap.insert(std::pair<std::string, AttributeProxy*>(GenericAttribute::getIdentifier(), new ArcAttributeProxy<GenericAttribute>));

}

Member Data Documentation

Definition at line 25 of file AttributeFactory.h.


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