/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Attributes | Private Attributes
DetElemContainsRule< Q > Class Template Reference

#include <HistorianCustomRules.h>

Inheritance diagram for DetElemContainsRule< Q >:
Inheritance graph
[legend]
Collaboration diagram for DetElemContainsRule< Q >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DetElemContainsRule (std::string n, const IDetectorElement *value)
virtual ~DetElemContainsRule ()
virtual bool select (const RuleParser::Queriable *thing)
virtual const std::string & name () const

Protected Attributes

std::string m_name
RulemA
RulemB

Private Attributes

const IDetectorElement * mValue

Detailed Description

template<class Q>
class DetElemContainsRule< Q >

Definition at line 28 of file HistorianCustomRules.h.


Constructor & Destructor Documentation

template<class Q>
DetElemContainsRule< Q >::DetElemContainsRule ( std::string  n,
const IDetectorElement *  value 
) [inline]

Definition at line 31 of file HistorianCustomRules.h.

          : Rule(n) 
          , mValue(value) {};
template<class Q>
virtual DetElemContainsRule< Q >::~DetElemContainsRule ( ) [inline, virtual]

Definition at line 34 of file HistorianCustomRules.h.

{};

Member Function Documentation

template<class Q >
bool DetElemContainsRule< Q >::select ( const RuleParser::Queriable thing) [virtual]

Implements RuleParser::Rule.

Definition at line 43 of file HistorianCustomRules.h.

 {
   const Q* q = dynamic_cast<const Q*>(thing);
   assert(q && "Was given the wrong kind of Queriable!");
   const IDetectorElement* curElement = q->getDetectorElement();
   if(!curElement) return false;
   if(!mValue) return false;
   // The problem with this method is that parentIDetectorElement() seems to crash.
   // bool done = false;
   // while(!done) {
   //   if(curElement == mValue) return true;
   //   if(curElement == 0) return false;
   //   curElement = curElement->parentIDetectorElement();
   // }
   const IGeometryInfo* curGeo = curElement->geometry();
   const IGeometryInfo* valGeo = mValue->geometry();
   ILVolume::ReplicaPath dummy;
   while(true){
     if(!curGeo) break;  // We got to the top of the tree and never hit the Value
     if(curGeo == valGeo) return true; // The value matches a parent of the current position.. it's contained
     IGeometryInfo* nextGeo = 0;
     curGeo->location(nextGeo, dummy); 
     curGeo = nextGeo;  // Ok, move up a level and check again.
   }
   return false;
}

Member Data Documentation

template<class Q>
const IDetectorElement* DetElemContainsRule< Q >::mValue [private]

Definition at line 37 of file HistorianCustomRules.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:18:33 for Historian by doxygen 1.7.4