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 96 of file FWSimpleRepresentationChecker.cc.

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

Referenced by FWDetailViewManager::findViewersFor().

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