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

CPPTemplateScope Class Reference

This is an implicit scope that is created following the appearance of a "template<class x, class y>" or some such line in a C++ file. More...

#include <cppTemplateScope.h>

Inheritance diagram for CPPTemplateScope:

CPPScope List of all members.

Public Types

typedef vector< CPPDeclaration * > Declarations
typedef map< string, CPPType * > ExtensionTypes
typedef map< string, CPPNamespace * > Namespaces
typedef map< string, CPPTypedef * > Typedefs
typedef map< string, CPPInstance * > Variables
typedef map< string, CPPFunctionGroup * > Functions
typedef map< string, CPPDeclaration * > Templates

Public Member Functions

 CPPTemplateScope (CPPScope *parent_scope)
void add_template_parameter (CPPDeclaration *param)
virtual void add_declaration (CPPDeclaration *decl, CPPScope *global_scope, CPPPreprocessor *preprocessor, const cppyyltype &pos)
virtual void add_enum_value (CPPInstance *inst)
virtual void define_extension_type (CPPExtensionType *type)
virtual void define_namespace (CPPNamespace *scope)
virtual void add_using (CPPUsing *using_decl, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL)
virtual bool is_fully_specified () const
 Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated.

virtual string get_simple_name () const
virtual string get_local_name (CPPScope *scope=NULL) const
virtual string get_fully_scoped_name () const
virtual void output (ostream &out, CPPScope *scope) const
virtual CPPTemplateScope * as_template_scope ()
void set_current_vis (CPPVisibility current_vis)
CPPVisibility get_current_vis () const
void set_struct_type (CPPStructType *struct_type)
 Sets the struct or class that owns this scope.

CPPStructTypeget_struct_type () const
 Returns the class or struct that defines this scope, if any.

CPPScopeget_parent_scope () const
 Returns the parent scope of this scope, if any.

CPPScopeinstantiate (const CPPTemplateParameterList *actual_params, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const
CPPScopesubstitute_decl (CPPDeclaration::SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) const
CPPTypefind_type (const string &name, bool recurse=true) const
CPPTypefind_type (const string &name, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope, bool recurse=true) const
CPPScopefind_scope (const string &name, bool recurse=true) const
CPPScopefind_scope (const string &name, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope, bool recurse=true) const
CPPDeclarationfind_symbol (const string &name, bool recurse=true) const
CPPDeclarationfind_template (const string &name, bool recurse=true) const
void write (ostream &out, int indent, CPPScope *scope) const
CPPTemplateScope * get_template_scope ()
 Returns the nearest ancestor of this scope that is a template scope, or NULL if the scope is fully specified.


Public Attributes

CPPTemplateParameterList _parameters
Declarations _declarations
ExtensionTypes _structs
ExtensionTypes _classes
ExtensionTypes _unions
ExtensionTypes _enums
Namespaces _namespaces
Typedefs _typedefs
Variables _variables
Variables _enum_values
Functions _functions
Templates _templates
CPPNameComponent _name

Protected Types

typedef set< CPPScope * > Using

Protected Attributes

CPPScope_parent_scope
CPPStructType_struct_type
Using _using
CPPVisibility _current_vis

Detailed Description

This is an implicit scope that is created following the appearance of a "template<class x, class y>" or some such line in a C++ file.

It simply defines the template parameters.

Definition at line 43 of file cppTemplateScope.h.


Member Typedef Documentation

typedef vector<CPPDeclaration *> CPPScope::Declarations [inherited]
 

Definition at line 126 of file cppScope.h.

typedef map<string, CPPType *> CPPScope::ExtensionTypes [inherited]
 

Definition at line 129 of file cppScope.h.

typedef map<string, CPPFunctionGroup *> CPPScope::Functions [inherited]
 

Definition at line 143 of file cppScope.h.

typedef map<string, CPPNamespace *> CPPScope::Namespaces [inherited]
 

Definition at line 135 of file cppScope.h.

typedef map<string, CPPDeclaration *> CPPScope::Templates [inherited]
 

Definition at line 145 of file cppScope.h.

typedef map<string, CPPTypedef *> CPPScope::Typedefs [inherited]
 

Definition at line 138 of file cppScope.h.

typedef set<CPPScope *> CPPScope::Using [protected, inherited]
 

Definition at line 152 of file cppScope.h.

typedef map<string, CPPInstance *> CPPScope::Variables [inherited]
 

Definition at line 140 of file cppScope.h.


Constructor & Destructor Documentation

CPPTemplateScope::CPPTemplateScope CPPScope parent_scope  ) 
 

Definition at line 37 of file cppTemplateScope.cxx.

References CPPScope::_parent_scope, CPPDeclaration::_template_scope, CPPScope::add_declaration(), global_scope, and NULL.


Member Function Documentation

void CPPTemplateScope::add_declaration CPPDeclaration decl,
CPPScope global_scope,
CPPPreprocessor preprocessor,
const cppyyltype pos
[virtual]
 

Reimplemented from CPPScope.

Definition at line 51 of file cppTemplateScope.cxx.

References CPPScope::_parent_scope, CPPDeclaration::_template_scope, CPPScope::add_enum_value(), and NULL.

void CPPTemplateScope::add_enum_value CPPInstance inst  )  [virtual]
 

Reimplemented from CPPScope.

Definition at line 67 of file cppTemplateScope.cxx.

References CPPScope::_parent_scope, CPPDeclaration::_template_scope, CPPScope::define_extension_type(), and NULL.

void CPPTemplateScope::add_template_parameter CPPDeclaration param  ) 
 

Definition at line 122 of file cppTemplateScope.cxx.

void CPPTemplateScope::add_using CPPUsing using_decl,
CPPScope global_scope,
CPPPreprocessor error_sink = NULL
[virtual]
 

Reimplemented from CPPScope.

Definition at line 108 of file cppTemplateScope.cxx.

References CPPClassTemplateParameter::_ident, CPPScope::_typedefs, CPPIdentifier::get_local_name(), and NULL.

CPPTemplateScope * CPPTemplateScope::as_template_scope  )  [virtual]
 

Reimplemented from CPPScope.

Definition at line 221 of file cppTemplateScope.cxx.

void CPPTemplateScope::define_extension_type CPPExtensionType type  )  [virtual]
 

Reimplemented from CPPScope.

Definition at line 81 of file cppTemplateScope.cxx.

References CPPScope::_parent_scope, CPPScope::define_namespace(), and NULL.

void CPPTemplateScope::define_namespace CPPNamespace scope  )  [virtual]
 

Reimplemented from CPPScope.

Definition at line 95 of file cppTemplateScope.cxx.

References CPPScope::_parent_scope.

CPPScope * CPPScope::find_scope const string &  name,
CPPDeclaration::SubstDecl subst,
CPPScope global_scope,
bool  recurse = true
const [inherited]
 

Definition at line 642 of file cppScope.cxx.

CPPScope * CPPScope::find_scope const string &  name,
bool  recurse = true
const [inherited]
 

Definition at line 587 of file cppScope.cxx.

References CPPStructType::_scope, CPPDeclaration::as_struct_type(), CPPScope::find_type(), global_scope, and NULL.

Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_fully_specified().

CPPDeclaration * CPPScope::find_symbol const string &  name,
bool  recurse = true
const [inherited]
 

Definition at line 663 of file cppScope.cxx.

References NULL.

CPPDeclaration * CPPScope::find_template const string &  name,
bool  recurse = true
const [inherited]
 

Definition at line 729 of file cppScope.cxx.

References CPPScope::_parent_scope, CPPScope::get_local_name(), CPPNameComponent::get_name_with_templ(), and NULL.

CPPType * CPPScope::find_type const string &  name,
CPPDeclaration::SubstDecl subst,
CPPScope global_scope,
bool  recurse = true
const [inherited]
 

Definition at line 538 of file cppScope.cxx.

References CPPScope::_namespaces.

CPPType * CPPScope::find_type const string &  name,
bool  recurse = true
const [inherited]
 

Definition at line 493 of file cppScope.cxx.

References CPPScope::_typedefs, current_scope, global_scope, and CPPScope::substitute_decl().

Referenced by CPPScope::find_scope(), CPPIdentifier::get_scope(), and CPPScope::substitute_decl().

CPPVisibility CPPScope::get_current_vis  )  const [inherited]
 

Definition at line 143 of file cppScope.cxx.

string CPPTemplateScope::get_fully_scoped_name  )  const [virtual]
 

Reimplemented from CPPScope.

Definition at line 193 of file cppTemplateScope.cxx.

string CPPTemplateScope::get_local_name CPPScope scope = NULL  )  const [virtual]
 

Reimplemented from CPPScope.

Definition at line 180 of file cppTemplateScope.cxx.

CPPScope * CPPScope::get_parent_scope  )  const [inherited]
 

Returns the parent scope of this scope, if any.

Definition at line 119 of file cppScope.cxx.

References CPPScope::_current_vis.

string CPPTemplateScope::get_simple_name  )  const [virtual]
 

Reimplemented from CPPScope.

Definition at line 167 of file cppTemplateScope.cxx.

CPPStructType * CPPScope::get_struct_type  )  const [inherited]
 

Returns the class or struct that defines this scope, if any.

Definition at line 106 of file cppScope.cxx.

References CPPScope::_current_vis.

CPPTemplateScope * CPPScope::get_template_scope  )  [inherited]
 

Returns the nearest ancestor of this scope that is a template scope, or NULL if the scope is fully specified.

Definition at line 889 of file cppScope.cxx.

Referenced by CPPScope::get_fully_scoped_name().

CPPScope * CPPScope::instantiate const CPPTemplateParameterList actual_params,
CPPScope current_scope,
CPPScope global_scope,
CPPPreprocessor error_sink = NULL
const [inherited]
 

Definition at line 359 of file cppScope.cxx.

References NULL.

Referenced by CPPIdentifier::get_scope().

bool CPPTemplateScope::is_fully_specified  )  const [virtual]
 

Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated.

Reimplemented from CPPScope.

Definition at line 155 of file cppTemplateScope.cxx.

References CPPScope::_parent_scope.

void CPPTemplateScope::output ostream &  out,
CPPScope scope
const [virtual]
 

Reimplemented from CPPScope.

Definition at line 206 of file cppTemplateScope.cxx.

void CPPScope::set_current_vis CPPVisibility  current_vis  )  [inherited]
 

Definition at line 131 of file cppScope.cxx.

References CPPDeclaration::_leading_comment, cppyyltype::file, cppyyltype::first_line, CPPPreprocessor::get_comment_before(), and NULL.

void CPPScope::set_struct_type CPPStructType struct_type  )  [inherited]
 

Sets the struct or class that owns this scope.

This should only be done once, when the scope and its associated struct are created. It's provided so the scope can check the struct's ancestry for inherited symbols.

Definition at line 91 of file cppScope.cxx.

References CPPScope::_parent_scope.

CPPScope * CPPScope::substitute_decl CPPDeclaration::SubstDecl subst,
CPPScope current_scope,
CPPScope global_scope
const [inherited]
 

Definition at line 440 of file cppScope.cxx.

References CPPStructType::_derivation, CPPScope::_parent_scope, CPPStructType::_scope, CPPScope::_struct_type, CPPScope::_typedefs, CPPScope::_using, CPPScope::find_type(), and NULL.

Referenced by CPPScope::find_type().

void CPPScope::write ostream &  out,
int  indent,
CPPScope scope
const [inherited]
 

Definition at line 854 of file cppScope.cxx.

References CPPStructType::Base::_base, CPPStructType::_derivation, CPPDeclaration::_file, CPPExtensionType::_ident, CPPStructType::_incomplete, CPPScope::_name, CPPIdentifier::_native_scope, CPPScope::_struct_type, CPPExtensionType::_type, CPPDeclaration::as_type(), global_scope, NULL, and CPPDeclaration::substitute_decl().


Member Data Documentation

ExtensionTypes CPPScope::_classes [inherited]
 

Definition at line 131 of file cppScope.h.

CPPVisibility CPPScope::_current_vis [protected, inherited]
 

Definition at line 154 of file cppScope.h.

Referenced by CPPScope::get_parent_scope(), and CPPScope::get_struct_type().

Declarations CPPScope::_declarations [inherited]
 

Definition at line 127 of file cppScope.h.

Referenced by InterrogateBuilder::remap_indices(), and TypeManager::wrap_const_pointer().

Variables CPPScope::_enum_values [inherited]
 

Definition at line 142 of file cppScope.h.

Referenced by CPPScope::add_declaration().

ExtensionTypes CPPScope::_enums [inherited]
 

Definition at line 133 of file cppScope.h.

Referenced by CPPScope::add_enum_value().

Functions CPPScope::_functions [inherited]
 

Definition at line 144 of file cppScope.h.

Referenced by CPPStructType::check_virtual().

CPPNameComponent CPPScope::_name [inherited]
 

Definition at line 147 of file cppScope.h.

Referenced by CPPScope::is_fully_specified(), and CPPScope::write().

Namespaces CPPScope::_namespaces [inherited]
 

Definition at line 136 of file cppScope.h.

Referenced by CPPScope::find_type().

CPPTemplateParameterList CPPTemplateScope::_parameters
 

Definition at line 68 of file cppTemplateScope.h.

Referenced by CPPScope::is_fully_specified().

CPPScope* CPPScope::_parent_scope [protected, inherited]
 

Definition at line 150 of file cppScope.h.

Referenced by add_declaration(), add_enum_value(), CPPTemplateScope(), define_extension_type(), define_namespace(), CPPScope::find_template(), CPPScope::get_fully_scoped_name(), CPPScope::get_simple_name(), is_fully_specified(), CPPScope::is_fully_specified(), CPPScope::set_struct_type(), and CPPScope::substitute_decl().

CPPStructType* CPPScope::_struct_type [protected, inherited]
 

Definition at line 151 of file cppScope.h.

Referenced by CPPScope::CPPScope(), CPPScope::substitute_decl(), CPPScope::write(), and CPPScope::~CPPScope().

ExtensionTypes CPPScope::_structs [inherited]
 

Definition at line 130 of file cppScope.h.

Templates CPPScope::_templates [inherited]
 

Definition at line 146 of file cppScope.h.

Typedefs CPPScope::_typedefs [inherited]
 

Definition at line 139 of file cppScope.h.

Referenced by add_using(), CPPScope::find_type(), and CPPScope::substitute_decl().

ExtensionTypes CPPScope::_unions [inherited]
 

Definition at line 132 of file cppScope.h.

Referenced by CPPScope::add_enum_value().

Using CPPScope::_using [protected, inherited]
 

Definition at line 153 of file cppScope.h.

Referenced by CPPScope::substitute_decl().

Variables CPPScope::_variables [inherited]
 

Definition at line 141 of file cppScope.h.


The documentation for this class was generated from the following files:
Generated on Thu May 1 22:13:28 2003 for DTool by doxygen1.3