Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TypeRegistryNode Class Reference

This is a single entry in the TypeRegistry. More...

#include <typeRegistryNode.h>

List of all members.

Public Types

typedef pvector< TypeRegistryNode * > Classes

Public Member Functions

 TypeRegistryNode (TypeHandle handle, const string &name, TypeHandle &ref)
void clear_subtree ()
 Removes any subtree definition previously set up via define_subtree(), in preparation for rebuilding the subtree data.

void define_subtree ()
 Indicates that this TypeRegistryNode is the top of a subtree within the inheritance graph (typically, this indicates a multiple-inheritance node).


Static Public Member Functions

bool is_derived_from (const TypeRegistryNode *child, const TypeRegistryNode *base)
 Returns true if the child RegistryNode represents a class that inherits directly or indirectly from the class represented by the base RegistryNode.

TypeHandle get_parent_towards (const TypeRegistryNode *child, const TypeRegistryNode *base)
 Returns the first parent class of child that is a descendant of the indicated base class.


Public Attributes

TypeHandle _handle
string _name
TypeHandle_ref
Classes _parent_classes
Classes _child_classes

Static Public Attributes

bool _paranoid_inheritance

Private Types

typedef int SubtreeMaskType
typedef pvector< InheritTopInheritance

Private Member Functions

void r_build_subtrees (TypeRegistryNode *top, int bit_count, SubtreeMaskType bits)
 Recursively builds up all the subtree cache information for this node and the ones below.


Static Private Member Functions

bool check_derived_from (const TypeRegistryNode *child, const TypeRegistryNode *base)
 A recursive function to double-check the result of is_derived_from().


Private Attributes

Inherit _inherit
TopInheritance _top_inheritance
int _visit_count


Detailed Description

This is a single entry in the TypeRegistry.

Normally, user code will never directly access this class; this class is hidden within the TypeRegistry accessors.

Definition at line 44 of file typeRegistryNode.h.


Member Typedef Documentation

typedef pvector<TypeRegistryNode *> TypeRegistryNode::Classes
 

Definition at line 60 of file typeRegistryNode.h.

typedef int TypeRegistryNode::SubtreeMaskType [private]
 

Definition at line 67 of file typeRegistryNode.h.

typedef pvector<Inherit> TypeRegistryNode::TopInheritance [private]
 

Definition at line 87 of file typeRegistryNode.h.


Constructor & Destructor Documentation

TypeRegistryNode::TypeRegistryNode TypeHandle  handle,
const string &  name,
TypeHandle ref
 

Definition at line 36 of file typeRegistryNode.cxx.


Member Function Documentation

bool TypeRegistryNode::check_derived_from const TypeRegistryNode *  child,
const TypeRegistryNode *  base
[static, private]
 

A recursive function to double-check the result of is_derived_from().

This is the slow, examine-the-whole-graph approach, as opposed to the clever and optimal algorithm of is_derived_from(); it's intended to be used only for debugging said clever algorithm.

Definition at line 391 of file typeRegistryNode.cxx.

Referenced by is_derived_from().

void TypeRegistryNode::clear_subtree  ) 
 

Removes any subtree definition previously set up via define_subtree(), in preparation for rebuilding the subtree data.

Definition at line 210 of file typeRegistryNode.cxx.

void TypeRegistryNode::define_subtree  ) 
 

Indicates that this TypeRegistryNode is the top of a subtree within the inheritance graph (typically, this indicates a multiple-inheritance node).

Builds all the subtree_mask etc. flags for nodes at this level and below.

Definition at line 233 of file typeRegistryNode.cxx.

Referenced by r_build_subtrees().

TypeHandle TypeRegistryNode::get_parent_towards const TypeRegistryNode *  child,
const TypeRegistryNode *  base
[static]
 

Returns the first parent class of child that is a descendant of the indicated base class.

Definition at line 179 of file typeRegistryNode.cxx.

Referenced by TypeRegistry::get_num_parent_classes().

bool TypeRegistryNode::is_derived_from const TypeRegistryNode *  child,
const TypeRegistryNode *  base
[static]
 

Returns true if the child RegistryNode represents a class that inherits directly or indirectly from the class represented by the base RegistryNode.

Definition at line 55 of file typeRegistryNode.cxx.

References TypeRegistryNode::Inherit::_bits, _inherit, TypeRegistryNode::Inherit::_mask, _name, TypeRegistryNode::Inherit::_top, check_derived_from(), nassertr, and NULL.

Referenced by TypeRegistry::freshen_derivations().

void TypeRegistryNode::r_build_subtrees TypeRegistryNode *  top,
int  bit_count,
TypeRegistryNode::SubtreeMaskType  bits
[private]
 

Recursively builds up all the subtree cache information for this node and the ones below.

This information is used to quickly determine class inheritance.

Definition at line 263 of file typeRegistryNode.cxx.

References _inherit, _parent_classes, TypeRegistryNode::Inherit::_top, _top_inheritance, _visit_count, define_subtree(), nassertv, and NULL.


Member Data Documentation

Classes TypeRegistryNode::_child_classes
 

Definition at line 62 of file typeRegistryNode.h.

Referenced by TypeRegistry::get_root_class(), and TypeRegistry::write().

TypeHandle TypeRegistryNode::_handle
 

Definition at line 57 of file typeRegistryNode.h.

Referenced by TypeRegistry::get_parent_class(), and TypeRegistry::write().

Inherit TypeRegistryNode::_inherit [private]
 

Definition at line 95 of file typeRegistryNode.h.

Referenced by is_derived_from(), and r_build_subtrees().

string TypeRegistryNode::_name
 

Definition at line 58 of file typeRegistryNode.h.

Referenced by TypeRegistry::get_parent_class(), is_derived_from(), TypeRegistry::record_alternate_name(), TypeRegistry::record_derivation(), and TypeRegistry::write().

bool TypeRegistryNode::_paranoid_inheritance [static]
 

Definition at line 26 of file typeRegistryNode.cxx.

Referenced by TypeRegistry::get_parent_towards().

Classes TypeRegistryNode::_parent_classes
 

Definition at line 61 of file typeRegistryNode.h.

Referenced by TypeRegistry::get_name(), r_build_subtrees(), and TypeRegistry::write().

TypeHandle& TypeRegistryNode::_ref
 

Definition at line 59 of file typeRegistryNode.h.

Referenced by TypeRegistry::get_parent_class().

TopInheritance TypeRegistryNode::_top_inheritance [private]
 

Definition at line 101 of file typeRegistryNode.h.

Referenced by r_build_subtrees().

int TypeRegistryNode::_visit_count [private]
 

Definition at line 104 of file typeRegistryNode.h.

Referenced by r_build_subtrees().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:56:01 2003 for Panda by doxygen1.3