CsEntity Struct Reference

Abstract Entity class. Base class for all entity classes. More...

Inheritance diagram for CsEntity:
CsEntityAnonymousMethod CsEntityBlockVariable CsEntityConstantBase CsEntityEvent CsEntityFormalParameter CsEntityGenericParam CsEntityLocalVariable CsEntityMethod CsEntityProperty CsEntityVariable CsScopeEntity

List of all members.

Classes

struct  entity_name_options
 Entity name generation options. More...

Public Member Functions

 CsEntity (cs_entity type_, cs_entity_access ac, WPHashString name_, AssemblyEntity *assembly_)
 CsEntity (cs_entity type_, cs_entity_access ac, WPHashString name_)
 CsEntity (cs_entity type_, cs_entity_access ac)
virtual ~CsEntity ()
virtual void visit (CsEntityVisitor *visitor)=0
bool isNamespaceOrType () const
 Returns true if it is a namespace or type entity.
bool isNamespaceOrTypeRef () const
 Returns true if it is a namespace or type reference entity.
bool isType () const
 Returns true if entity is type.
bool isEnum () const
 Returns true if entity is enum.
bool isTypeRef () const
 Returns true if it is a type reference entity.
bool isNamespace () const
 Returns true if it is a namespace entity.
bool isIdentifier () const
bool isField () const
 Returns true if it is a field entity.
bool isMethod () const
 Returns true if it is a method entity.
bool isProperty () const
 Returns true if it is a property entity.
bool isGenericParam () const
 Returns true if it is a generic parameter entity.
bool isVirtualMethod () const
 Returns true if it is a virtual method entity.
bool isOverride () const
 Returns true if it is a override entity.
virtual void setStatic (bool flag)
virtual bool isStatic () const
 Returns true if it is a static entity.
int isBaseClassResolved () const
void setBaseClassResolved ()
void setPartial (bool flag)
int isPartial () const
 Returns true if it is a partial entity.
int isEffectiveBaseEvaluated () const
void setEffectiveBaseEvaluated ()
int isGenerated () const
int isCompilerAttribute () const
int isRecursiveInheritance () const
void setRecursiveInheritance ()
int isChecked () const
void setChecked ()
bool isLocalEntity () const
bool isPropertyEvent () const
bool isMethodPropertyEvent () const
bool isSkip () const
void setSkip (bool flag)
bool isMarkDelete () const
void setMarkDelete (bool flag)
bool isAnonymousType () const
 Returns true if it is a anonymous type entity.
void setAnonymousType (bool flag)
virtual void setDynamicType ()
virtual void setDynamicType (bool *traverseFlags)
bool isDefinedInExternalAssembly () const
 Returns true if entity defined in external assembly (for types, methods, fields, properties, events only).
const TCHAR * getNameAsString (entity_name_options &options) const
 Generates entity name.

Static Public Member Functions

static add_entity_check isCompatible (const CsEntity *lhs, const CsEntity *rhs)
static bool isParentChild (CsEntity *parent, CsEntity *child)
static void free_static_memory ()

Public Attributes

cs_entity e: 8
 Entity type enumeration.
cs_entity_access access: 8
 Access to entity.
unsigned __int16 pflags
 Parser flags (for internal purpose only).
PHashString name
 Entity name. Name maybe compound (like "a.b.c") for explicit interface implementation entitites. Name is null for global namespace, blocks and unresolved explicit interface implementation entitites.
unsigned __int32 mflags
 Metadata flags (imported from assembly or generated by parser).
CsEntityparent
 Outer scope of entity. Non-null for all entities except global namespace.
AssemblyEntityassembly
 Assembly where entity was defined. Always null for entities generated by parser and namespaces.

Private Member Functions

size_t add_name_to_buffer (entity_name_options &options, size_t position) const
size_t add_name_to_buffer (size_t position, bool bGenericParameters) const

Static Private Member Functions

static size_t add_string_to_buffer (size_t position, const TCHAR *s, size_t len)
static size_t add_type_parameters_to_buffer (size_t position, const CsEntityType *type)
static void grow_scope_name_buffer (size_t expected_size)

Static Private Attributes

static TCHAR * scope_name_buffer_
static size_t scope_name_buffer_size_
static const size_t scope_name_buffer_size_start_ = 128

Friends

struct CsEntityTypeRef
struct CsEntityArraySpecifier
struct CsEntityMethodSpecifier
struct CsEntityInstanceSpecifier

Detailed Description

Abstract Entity class. Base class for all entity classes.


Constructor & Destructor Documentation

CsEntity::CsEntity ( cs_entity  type_,
cs_entity_access  ac,
WPHashString  name_,
AssemblyEntity assembly_ 
) [inline]
CsEntity::CsEntity ( cs_entity  type_,
cs_entity_access  ac,
WPHashString  name_ 
) [inline]
CsEntity::CsEntity ( cs_entity  type_,
cs_entity_access  ac 
) [inline]
virtual CsEntity::~CsEntity (  )  [inline, virtual]

Member Function Documentation

size_t CsEntity::add_name_to_buffer ( size_t  position,
bool  bGenericParameters 
) const [private]
size_t CsEntity::add_name_to_buffer ( entity_name_options options,
size_t  position 
) const [private]
static size_t CsEntity::add_string_to_buffer ( size_t  position,
const TCHAR *  s,
size_t  len 
) [static, private]
static size_t CsEntity::add_type_parameters_to_buffer ( size_t  position,
const CsEntityType type 
) [static, private]
static void CsEntity::free_static_memory (  )  [static]
const TCHAR* CsEntity::getNameAsString ( entity_name_options options  )  const

Generates entity name.

static void CsEntity::grow_scope_name_buffer ( size_t  expected_size  )  [static, private]
bool CsEntity::isAnonymousType (  )  const [inline]

Returns true if it is a anonymous type entity.

int CsEntity::isBaseClassResolved (  )  const [inline]
int CsEntity::isChecked (  )  const [inline]
static add_entity_check CsEntity::isCompatible ( const CsEntity lhs,
const CsEntity rhs 
) [static]
int CsEntity::isCompilerAttribute (  )  const [inline]
bool CsEntity::isDefinedInExternalAssembly (  )  const

Returns true if entity defined in external assembly (for types, methods, fields, properties, events only).

int CsEntity::isEffectiveBaseEvaluated (  )  const [inline]
bool CsEntity::isEnum (  )  const [inline]

Returns true if entity is enum.

bool CsEntity::isField (  )  const [inline]

Returns true if it is a field entity.

int CsEntity::isGenerated (  )  const [inline]
bool CsEntity::isGenericParam (  )  const [inline]

Returns true if it is a generic parameter entity.

bool CsEntity::isIdentifier (  )  const [inline]
bool CsEntity::isLocalEntity (  )  const [inline]
bool CsEntity::isMarkDelete (  )  const [inline]
bool CsEntity::isMethod (  )  const [inline]

Returns true if it is a method entity.

bool CsEntity::isMethodPropertyEvent (  )  const [inline]
bool CsEntity::isNamespace (  )  const [inline]

Returns true if it is a namespace entity.

bool CsEntity::isNamespaceOrType (  )  const [inline]

Returns true if it is a namespace or type entity.

bool CsEntity::isNamespaceOrTypeRef (  )  const [inline]

Returns true if it is a namespace or type reference entity.

bool CsEntity::isOverride (  )  const [inline]

Returns true if it is a override entity.

static bool CsEntity::isParentChild ( CsEntity parent,
CsEntity child 
) [inline, static]
int CsEntity::isPartial (  )  const [inline]

Returns true if it is a partial entity.

bool CsEntity::isProperty (  )  const [inline]

Returns true if it is a property entity.

bool CsEntity::isPropertyEvent (  )  const [inline]
int CsEntity::isRecursiveInheritance (  )  const [inline]
bool CsEntity::isSkip (  )  const [inline]
virtual bool CsEntity::isStatic (  )  const [inline, virtual]

Returns true if it is a static entity.

Reimplemented in CsEntityMethod, CsEntityType, CsEntityConstant, CsEntityVariable, CsEntityProperty, and CsEntityEvent.

bool CsEntity::isType (  )  const [inline]

Returns true if entity is type.

bool CsEntity::isTypeRef (  )  const [inline]

Returns true if it is a type reference entity.

bool CsEntity::isVirtualMethod (  )  const [inline]

Returns true if it is a virtual method entity.

void CsEntity::setAnonymousType ( bool  flag  )  [inline]
void CsEntity::setBaseClassResolved (  )  [inline]
void CsEntity::setChecked (  )  [inline]
virtual void CsEntity::setDynamicType ( bool *  traverseFlags  )  [inline, virtual]
virtual void CsEntity::setDynamicType (  )  [inline, virtual]
void CsEntity::setEffectiveBaseEvaluated (  )  [inline]
void CsEntity::setMarkDelete ( bool  flag  )  [inline]
void CsEntity::setPartial ( bool  flag  )  [inline]
void CsEntity::setRecursiveInheritance (  )  [inline]
void CsEntity::setSkip ( bool  flag  )  [inline]
virtual void CsEntity::setStatic ( bool  flag  )  [inline, virtual]

Friends And Related Function Documentation

friend struct CsEntityArraySpecifier [friend]
friend struct CsEntityInstanceSpecifier [friend]
friend struct CsEntityMethodSpecifier [friend]
friend struct CsEntityTypeRef [friend]

Reimplemented in CsEntityType.


Member Data Documentation

cs_entity_access CsEntity::access

Access to entity.

Assembly where entity was defined. Always null for entities generated by parser and namespaces.

cs_entity CsEntity::e

Entity type enumeration.

unsigned __int32 CsEntity::mflags

Metadata flags (imported from assembly or generated by parser).

PHashString CsEntity::name

Entity name. Name maybe compound (like "a.b.c") for explicit interface implementation entitites. Name is null for global namespace, blocks and unresolved explicit interface implementation entitites.

Outer scope of entity. Non-null for all entities except global namespace.

unsigned __int16 CsEntity::pflags

Parser flags (for internal purpose only).

TCHAR* CsEntity::scope_name_buffer_ [static, private]
size_t CsEntity::scope_name_buffer_size_ [static, private]
const size_t CsEntity::scope_name_buffer_size_start_ = 128 [static, private]
© 2010 metaspec