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

CPPTemplateParameterList Class Reference

This class serves to store the parameter list for a template function or class, both for the formal parameter list (given when the template is defined) and for the actual parameter list (given when the template is instantiated). More...

#include <cppTemplateParameterList.h>

List of all members.

Public Types

typedef vector< CPPDeclaration * > Parameters

Public Member Functions

 CPPTemplateParameterList ()
string get_string () const
void build_subst_decl (const CPPTemplateParameterList &formal_params, CPPDeclaration::SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) const
 Matches up the actual parameters one-to-one with the formal parameters they are replacing, so the template may be instantiated by swapping out each occurrence of a template standin type with its appropriate replacement.

bool is_fully_specified () const
 This function returns true if all the parameters in the list are real expressions or classes, and not types yet to-be-determined or template parameter types.

bool is_tbd () const
 Returns true if any type within the parameter list is a CPPTBDType and thus isn't fully determined right now.

bool operator== (const CPPTemplateParameterList &other) const
bool operator!= (const CPPTemplateParameterList &other) const
bool operator< (const CPPTemplateParameterList &other) const
CPPTemplateParameterList * substitute_decl (CPPDeclaration::SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope)
void output (ostream &out, CPPScope *scope) const
void write_formal (ostream &out, CPPScope *scope) const
 Writes the list as a set of formal parameters for a template scope.


Public Attributes

Parameters _parameters


Detailed Description

This class serves to store the parameter list for a template function or class, both for the formal parameter list (given when the template is defined) and for the actual parameter list (given when the template is instantiated).

Definition at line 49 of file cppTemplateParameterList.h.


Member Typedef Documentation

typedef vector<CPPDeclaration *> CPPTemplateParameterList::Parameters
 

Definition at line 72 of file cppTemplateParameterList.h.


Constructor & Destructor Documentation

CPPTemplateParameterList::CPPTemplateParameterList  ) 
 

Definition at line 36 of file cppTemplateParameterList.cxx.

References ostringstream::str().


Member Function Documentation

void CPPTemplateParameterList::build_subst_decl const CPPTemplateParameterList &  formal_params,
CPPDeclaration::SubstDecl subst,
CPPScope current_scope,
CPPScope global_scope
const
 

Matches up the actual parameters one-to-one with the formal parameters they are replacing, so the template may be instantiated by swapping out each occurrence of a template standin type with its appropriate replacement.

Definition at line 70 of file cppTemplateParameterList.cxx.

Referenced by CPPScope::is_fully_specified().

string CPPTemplateParameterList::get_string  )  const
 

Definition at line 47 of file cppTemplateParameterList.cxx.

References _parameters, CPPDeclaration::as_type(), current_scope, global_scope, and CPPType::resolve_type().

bool CPPTemplateParameterList::is_fully_specified  )  const
 

This function returns true if all the parameters in the list are real expressions or classes, and not types yet to-be-determined or template parameter types.

That is, this returns true for a normal template instantiation, and false for a template instantiation based on template parameters that have not yet been specified.

Definition at line 142 of file cppTemplateParameterList.cxx.

bool CPPTemplateParameterList::is_tbd  )  const
 

Returns true if any type within the parameter list is a CPPTBDType and thus isn't fully determined right now.

Definition at line 164 of file cppTemplateParameterList.cxx.

Referenced by CPPNameComponent::empty().

bool CPPTemplateParameterList::operator!= const CPPTemplateParameterList &  other  )  const
 

Definition at line 207 of file cppTemplateParameterList.cxx.

References _parameters.

bool CPPTemplateParameterList::operator< const CPPTemplateParameterList &  other  )  const
 

Definition at line 219 of file cppTemplateParameterList.cxx.

bool CPPTemplateParameterList::operator== const CPPTemplateParameterList &  other  )  const
 

Definition at line 187 of file cppTemplateParameterList.cxx.

References _parameters.

void CPPTemplateParameterList::output ostream &  out,
CPPScope scope
const
 

Definition at line 268 of file cppTemplateParameterList.cxx.

Referenced by CPPNameComponent::get_name().

CPPTemplateParameterList * CPPTemplateParameterList::substitute_decl CPPDeclaration::SubstDecl subst,
CPPScope current_scope,
CPPScope global_scope
 

Definition at line 239 of file cppTemplateParameterList.cxx.

void CPPTemplateParameterList::write_formal ostream &  out,
CPPScope scope
const
 

Writes the list as a set of formal parameters for a template scope.

Includes the keyword "template" and the angle brackets, as well as the trailing newline.

Definition at line 295 of file cppTemplateParameterList.cxx.


Member Data Documentation

Parameters CPPTemplateParameterList::_parameters
 

Definition at line 73 of file cppTemplateParameterList.h.

Referenced by get_string(), operator!=(), and operator==().


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