Back to index

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

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

#include <ArcFnFactory.h>

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

List of all members.

Public Member Functions

 ArcFnFactory ()
virtual ~ArcFnFactory ()
virtual FunctioncreateFn (const std::string &type)
 return a Function object according to the "Function" attribute in the XML node; The ArcFnFactory itself will release the Function objects

Protected Attributes

FnMap fnmap

Private Member Functions

void initFunctions ()

Detailed Description

Function factory class for Arc specified attributes.

Definition at line 11 of file ArcFnFactory.h.


Constructor & Destructor Documentation

Definition at line 95 of file ArcFnFactory.cpp.

                          {
  initFunctions();
}

Definition at line 106 of file ArcFnFactory.cpp.

                           {
  FnMap::iterator it;
  for(it = fnmap.begin(); it != fnmap.end(); it = fnmap.begin()){
    Function* fn = (*it).second;
    fnmap.erase(it);
    if(fn) delete fn;
  }
}

Member Function Documentation

Function * ArcSec::ArcFnFactory::createFn ( const std::string &  type) [virtual]

return a Function object according to the "Function" attribute in the XML node; The ArcFnFactory itself will release the Function objects

Implements ArcSec::FnFactory.

Definition at line 99 of file ArcFnFactory.cpp.

                                                     {
  FnMap::iterator it; 
  if((it=fnmap.find(type)) != fnmap.end())
    return (*it).second;
  else return NULL;
}

Some Arc specified function types

TODO: other function type.............

Definition at line 33 of file ArcFnFactory.cpp.

                                {
  //fnmap.insert(pair<std::string, Function*>(StringFunction.identify, new StringFunction));
  //fnmap.insert(pair<std::string, Function*>(DateMathFunction.identify, new DateMathFunction));
  //EqualFunctions
  std::string fnName = EqualFunction::getFunctionName(StringAttribute::getIdentifier());
  std::string argType = StringAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(DateTimeAttribute::getIdentifier());
  argType = DateTimeAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(DateAttribute::getIdentifier());
  argType = DateAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(TimeAttribute::getIdentifier());
  argType = TimeAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(DurationAttribute::getIdentifier());
  argType = DurationAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(PeriodAttribute::getIdentifier());
  argType = PeriodAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(X500NameAttribute::getIdentifier());
  argType = X500NameAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(AnyURIAttribute::getIdentifier());
  argType = AnyURIAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  //MatchFunctions
  fnName = MatchFunction::getFunctionName(StringAttribute::getIdentifier());
  argType = StringAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new MatchFunction(fnName, argType)));

  fnName = MatchFunction::getFunctionName(X500NameAttribute::getIdentifier());
  argType = X500NameAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new MatchFunction(fnName, argType)));

  fnName = MatchFunction::getFunctionName(AnyURIAttribute::getIdentifier());
  argType = AnyURIAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new MatchFunction(fnName, argType)));

  //InRangeFunctions
  fnName = InRangeFunction::getFunctionName(StringAttribute::getIdentifier());
  argType = StringAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new InRangeFunction(fnName, argType)));

  fnName = InRangeFunction::getFunctionName(PeriodAttribute::getIdentifier());
  argType = PeriodAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new InRangeFunction(fnName, argType)));
}

Member Data Documentation

FnMap ArcSec::FnFactory::fnmap [protected, inherited]

Definition at line 32 of file FnFactory.h.


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