CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWSimpleRepresentationChecker Class Reference

#include <Fireworks/Core/interface/FWSimpleRepresentationChecker.h>

Inheritance diagram for FWSimpleRepresentationChecker:
FWRepresentationCheckerBase

Public Member Functions

 FWSimpleRepresentationChecker (const std::string &iTypeidName, const std::string &iPurpose, unsigned int iBitPackedViews, bool iRepresentsSubPart)
 
virtual FWRepresentationInfo infoFor (const std::string &iTypeName) const
 
virtual ~FWSimpleRepresentationChecker ()
 
- Public Member Functions inherited from FWRepresentationCheckerBase
unsigned int bitPackedViews () const
 
 FWRepresentationCheckerBase (const std::string &iPurpose, unsigned int iBitPackedViews, bool iRepresentsSubPart)
 
const std::string & purpose () const
 
bool representsSubPart () const
 
virtual ~FWRepresentationCheckerBase ()
 

Private Member Functions

 FWSimpleRepresentationChecker (const FWSimpleRepresentationChecker &)
 
const
FWSimpleRepresentationChecker
operator= (const FWSimpleRepresentationChecker &)
 

Private Attributes

const std::string m_typeidName
 

Detailed Description

Description: Used to check to see if a Simple proxy builder could be used to represent a particular type

Usage: <usage>

Definition at line 30 of file FWSimpleRepresentationChecker.h.

Constructor & Destructor Documentation

FWSimpleRepresentationChecker::FWSimpleRepresentationChecker ( const std::string &  iTypeidName,
const std::string &  iPurpose,
unsigned int  iBitPackedViews,
bool  iRepresentsSubPart 
)

Definition at line 38 of file FWSimpleRepresentationChecker.cc.

41  :
42  FWRepresentationCheckerBase(iPurpose,iBitPackedViews,iRepresentsSubPart),
43  m_typeidName(iTypeName)
44 {
45 }
FWRepresentationCheckerBase(const std::string &iPurpose, unsigned int iBitPackedViews, bool iRepresentsSubPart)
FWSimpleRepresentationChecker::~FWSimpleRepresentationChecker ( )
virtual

Definition at line 52 of file FWSimpleRepresentationChecker.cc.

53 {
54 }
FWSimpleRepresentationChecker::FWSimpleRepresentationChecker ( const FWSimpleRepresentationChecker )
private

Member Function Documentation

FWRepresentationInfo FWSimpleRepresentationChecker::infoFor ( const std::string &  iTypeName) const
virtual

Implements FWRepresentationCheckerBase.

Definition at line 98 of file FWSimpleRepresentationChecker.cc.

References FWItemAccessorFactory::accessorFor(), FWRepresentationCheckerBase::bitPackedViews(), inheritsFrom(), m_typeidName, FWRepresentationCheckerBase::purpose(), and FWRepresentationCheckerBase::representsSubPart().

Referenced by FWDetailViewManager::findViewersFor().

99 {
100  unsigned int distance=1;
101 
102  FWItemAccessorFactory factory;
103  //std::cout<<"checker infoFor"<<iTypeName<<std::endl;
104  TClass* clss = TClass::GetClass(iTypeName.c_str());
105  //Class could be unknown if the dictionary for it has not been loaded
106  if(0==clss || 0==clss->GetTypeInfo()) {
107  return FWRepresentationInfo();
108  }
109  boost::shared_ptr<FWItemAccessorBase> accessor = factory.accessorFor(clss);
110 
111  const TClass* modelClass = accessor->modelType();
112  //std::cout <<" "<<modelClass->GetName()<<" "<< bool(modelClass == clss)<< std::endl;
113 
114  if(0==modelClass || 0 == modelClass->GetTypeInfo()) {
115  //some containers e.g. vector<int> do not have known TClasses for their elements
116  // or the contained type may be unknown to ROOT
117  return FWRepresentationInfo();
118  }
119  Reflex::Type modelType =
120  Reflex::Type::ByTypeInfo( *(modelClass->GetTypeInfo()));
121  //see if the modelType inherits from our type
122 
123  if(inheritsFrom(modelType,m_typeidName,distance) ) {
125  }
126  return FWRepresentationInfo();
127 }
const std::string & purpose() const
static bool inheritsFrom(const Reflex::Type &iChild, const std::string &iParentTypeName, unsigned int &distance)
boost::shared_ptr< FWItemAccessorBase > accessorFor(const TClass *) const
const FWSimpleRepresentationChecker& FWSimpleRepresentationChecker::operator= ( const FWSimpleRepresentationChecker )
private

Member Data Documentation

const std::string FWSimpleRepresentationChecker::m_typeidName
private

Definition at line 52 of file FWSimpleRepresentationChecker.h.

Referenced by infoFor().