lestes::lang::cplus::sem::ss_function Class Reference

Class for function type. More...

#include <ss_type.g.hh>

Inheritance diagram for lestes::lang::cplus::sem::ss_function:

lestes::lang::cplus::sem::ss_type lestes::intercode::ss_base lestes::intercode::intercode lestes::std::object lestes::std::mem::keystone lestes::lang::cplus::sem::ss_member_function List of all members.

Public Member Functions

ptr< ss_typereturns_get () const
 The method returns_get returns the value of the field ss_function::returns.
void returns_set (const ptr< ss_type > &)
 The method returns_set sets the field ss_function::returns to the given value.
ptr< ::lestes::std::list<
srp< ss_type > > > 
params_get () const
 The method params_get returns the value of the field ss_function::params.
void params_set (const ptr< ::lestes::std::list< srp< ss_type > > > &)
 The method params_set sets the field ss_function::params to the given value.
bool ellipsis_get () const
 The method ellipsis_get returns the value of the field ss_function::ellipsis.
void ellipsis_set (bool)
 The method ellipsis_set sets the field ss_function::ellipsis to the given value.
bool less_than (ptr< ss_function > other)
 Compares to other ss_function for inequality.
bool equal_signature (ptr< ss_function > other)
 Compares to other ss_function signature.
virtual ptr< ::lestes::std::list<
srp< or_ics_functional > > > 
accept_or_ics_base (ptr< or_ics_base > v)
virtual or_cv_enum accept_or_ics_base_cv (ptr< or_ics_base_cv > v)
virtual ptr< ::lestes::md::types::tm_data_type_baseaccept_ss_type2tm_type_gen_base (ptr< ss_type2tm_type_gen_base > v)
virtual void accept_ss_type_visitor (ptr< ss_type_visitor > v)
virtual ptr< reflection_listreflection_get () const
 for purposes of dumping
virtual ptr< field_list_listfield_values_get () const
 for purposes of dumping

Static Public Member Functions

static ptr< ss_typeinstance (ptr< ss_type > return_type, ptr< ::lestes::std::list< srp< ss_type > > > param_types, bool ellipsis)
 Returns the instance representing specified function.
static ptr< ss_functioncreate (ptr< ss_type > a__ss_function__returns, ptr< ::lestes::std::list< srp< ss_type > > > a__ss_function__params, bool a__ss_function__ellipsis)
 First generated factory method for class ss_function.

Protected Member Functions

 ss_function (ptr< ss_type > a__ss_function__returns, ptr< ::lestes::std::list< srp< ss_type > > > a__ss_function__params, bool a__ss_function__ellipsis)
 Generated constructor for class ss_function.
virtual void gc_mark ()
 Marking routine for class ss_function.

Private Attributes

srp< ss_typereturns
 The return type of the function.
srp< ::lestes::std::list<
srp< ss_type > > > 
params
 The types of parameters of the function.
bool ellipsis
 Whether current function has an ellipsis(...) in function parameters.

Static Private Attributes

static ptr< ::lestes::std::set<
srp< ss_function >, ss_function_comparator > > 
instances = ::lestes::std::set< srp< ss_function >, ss_function_comparator > ::create()
 The singleton instances of the class.
static ptr< reflection_listreflection = reflection

Detailed Description

Class for function type.

Represents namespace function.

Definition at line 694 of file ss_type.g.hh.


Constructor & Destructor Documentation

lestes::lang::cplus::sem::ss_function::ss_function ( ptr< ss_type a__ss_function__returns,
ptr< ::lestes::std::list< srp< ss_type > > >  a__ss_function__params,
bool  a__ss_function__ellipsis 
) [protected]

Generated constructor for class ss_function.

Generated constructor for class ss_function.

Author:
lsg

Definition at line 1107 of file ss_type.g.cc.

Referenced by create().

01110         : ss_type(), returns(checked(a__ss_function__returns)), params(checked(a__ss_function__params)), ellipsis(a__ss_function__ellipsis)
01111 {}


Member Function Documentation

ptr< ss_type > lestes::lang::cplus::sem::ss_function::returns_get (  )  const

The method returns_get returns the value of the field ss_function::returns.

Returns:
The value of ss_function::returns.
Author:
lsg

Definition at line 1020 of file ss_type.g.cc.

References returns.

Referenced by less_than().

01021 {
01022         return returns;
01023 }

void lestes::lang::cplus::sem::ss_function::returns_set ( const ptr< ss_type > &  x  ) 

The method returns_set sets the field ss_function::returns to the given value.

Parameters:
[in] x The new value to set ss_function::returns to.
Author:
lsg

Definition at line 1029 of file ss_type.g.cc.

References returns.

01030 {
01031         ss_function::returns = x;
01032 }

ptr<::lestes::std::list< srp< ss_type > > > lestes::lang::cplus::sem::ss_function::params_get (  )  const

The method params_get returns the value of the field ss_function::params.

Returns:
The value of ss_function::params.
Author:
lsg

Definition at line 1038 of file ss_type.g.cc.

References params.

Referenced by equal_signature(), and less_than().

01039 {
01040         return params;
01041 }

void lestes::lang::cplus::sem::ss_function::params_set ( const ptr< ::lestes::std::list< srp< ss_type > > > &  x  ) 

The method params_set sets the field ss_function::params to the given value.

Parameters:
[in] x The new value to set ss_function::params to.
Author:
lsg

Definition at line 1047 of file ss_type.g.cc.

References params.

01048 {
01049         ss_function::params = x;
01050 }

bool lestes::lang::cplus::sem::ss_function::ellipsis_get (  )  const

The method ellipsis_get returns the value of the field ss_function::ellipsis.

Returns:
The value of ss_function::ellipsis.
Author:
lsg

Definition at line 1056 of file ss_type.g.cc.

References ellipsis.

Referenced by equal_signature(), and less_than().

01057 {
01058         return ellipsis;
01059 }

void lestes::lang::cplus::sem::ss_function::ellipsis_set ( bool  x  ) 

The method ellipsis_set sets the field ss_function::ellipsis to the given value.

Parameters:
[in] x The new value to set ss_function::ellipsis to.
Author:
lsg

Definition at line 1065 of file ss_type.g.cc.

References ellipsis.

01066 {
01067         ss_function::ellipsis = x;
01068 }

static ptr< ss_type > lestes::lang::cplus::sem::ss_function::instance ( ptr< ss_type return_type,
ptr< ::lestes::std::list< srp< ss_type > > >  param_types,
bool  ellipsis 
) [static]

Returns the instance representing specified function.

Referenced by lestes::lang::cplus::sem::or_builtin_operator_declaration_creator::construct_builtin_op().

bool lestes::lang::cplus::sem::ss_function::less_than ( ptr< ss_function other  ) 

Compares to other ss_function for inequality.

Compares to other ss_function in the defined ordering. Used for container comparator. The ordering considers (in this order) the first of the following to compare less: the ellipsis flag, the return value, and the parameter sequence. For the purpose of comparison, the value of the pointer determines the ordering for the objects representing data types, as these are all singletonized SS types and thus impose consistent ordering. The parameters are compared lexicographically in the usual manner, stopping at the first inequality. If there is none, the shorter sequence compares less.

Precondition:
other != NULL
Parameters:
other The other instance to compare to.
Returns:
true If this instance is less than the other in the defined ordering.

Definition at line 377 of file ss_type.cc.

References ellipsis_get(), lassert, params_get(), and returns_get().

00378 {
00379         lassert(other);
00380         
00381         if (ellipsis_get() != other->ellipsis_get())
00382                 return ellipsis_get() < other->ellipsis_get();
00383 
00384         if (returns_get() != other->returns_get())
00385                 return returns_get() < other->returns_get();
00386 
00387         typedef ::lestes::std::list< srp<ss_type> > ss_type_list;
00388         ptr<ss_type_list> p = params_get();
00389         ptr<ss_type_list> q = other->params_get();
00390 
00391         ss_type_list::iterator pi = p->begin(), qi = q->begin(), pe = p->end(), qe = q->end();
00392         for ( ; pi != pe && qi != qe; ++pi, ++qi) {
00393                 if (*pi != *qi)
00394                         return *pi < *qi;
00395         }
00396 
00397         // less when the other parameter list is longer
00398         return pi == pe && qi != qe;
00399 }

bool lestes::lang::cplus::sem::ss_function::equal_signature ( ptr< ss_function other  ) 

Compares to other ss_function signature.

Compares signatures ss_function in the defined ordering. Both functions have the same signature, if both have or have no ellipsis, if the parameter type sequences have the same length and the corresponding parameter types are the same.

Precondition:
other != NULL
Parameters:
other The other instance to compare to.
Returns:
true If this instance has the same signature.

Definition at line 410 of file ss_type.cc.

References ellipsis_get(), lassert, and params_get().

00411 {
00412         lassert(other);
00413 
00414         if (ellipsis_get() != other->ellipsis_get())
00415                 return false;
00416 
00417         typedef ::lestes::std::list< srp<ss_type> > ss_type_list;
00418         ptr<ss_type_list> p = params_get();
00419         ptr<ss_type_list> q = other->params_get();
00420 
00421         if (p->size() != q->size()) return false;
00422 
00423         for (ss_type_list::iterator pi = p->begin(), qi = q->begin(), pe = p->end(), qe = q->end();
00424                 pi != pe && qi != qe; ++pi, ++qi) {
00425                 if (*pi != *qi) return false;
00426         }
00427 
00428         return true;
00429 }

ptr<::lestes::std::list< srp< or_ics_functional > > > lestes::lang::cplus::sem::ss_function::accept_or_ics_base ( ptr< or_ics_base v  )  [virtual]

Implements lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1070 of file ss_type.g.cc.

01071 {
01072         return v->visit_ss_function( this );
01073 }

or_cv_enum lestes::lang::cplus::sem::ss_function::accept_or_ics_base_cv ( ptr< or_ics_base_cv v  )  [virtual]

Implements lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1075 of file ss_type.g.cc.

01076 {
01077         return v->visit_ss_function( this );
01078 }

ptr<::lestes::md::types::tm_data_type_base > lestes::lang::cplus::sem::ss_function::accept_ss_type2tm_type_gen_base ( ptr< ss_type2tm_type_gen_base v  )  [virtual]

Implements lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1080 of file ss_type.g.cc.

01081 {
01082         return v->visit_ss_function( this );
01083 }

void lestes::lang::cplus::sem::ss_function::accept_ss_type_visitor ( ptr< ss_type_visitor v  )  [virtual]

Implements lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1085 of file ss_type.g.cc.

01086 {
01087         return v->visit_ss_function( this );
01088 }

ptr< ss_function > lestes::lang::cplus::sem::ss_function::create ( ptr< ss_type a__ss_function__returns,
ptr< ::lestes::std::list< srp< ss_type > > >  a__ss_function__params,
bool  a__ss_function__ellipsis 
) [static]

First generated factory method for class ss_function.

This factory method for class ss_function takes values of all fields as arguments.

Author:
lsg

Definition at line 1094 of file ss_type.g.cc.

References ss_function().

01097 {
01098         return ptr< ss_function > ( new ss_function(a__ss_function__returns,
01099                 a__ss_function__params,
01100                 a__ss_function__ellipsis) );
01101 }

ptr< object::reflection_list > lestes::lang::cplus::sem::ss_function::reflection_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1113 of file ss_type.g.cc.

References lestes::std::list< T >::create(), reflection, and lestes::lang::cplus::sem::ss_type::reflection_get().

Referenced by lestes::lang::cplus::sem::ss_member_function::reflection_get().

01114 {
01115         if (!reflection) {
01116                 typedef class_reflection::field_metadata md;
01117                 typedef class_reflection::field_metadata_list mdlist;
01118                 ptr<mdlist> mdl = mdlist::create();
01119                 mdl->push_back( md::create( "instances", "set&lt; srp&lt; ss_function &gt;, ss_function_comparator &gt;" ) );
01120                 mdl->push_back( md::create( "returns", "ss_type" ) );
01121                 mdl->push_back( md::create( "params", "list&lt; srp&lt; ss_type &gt; &gt;" ) );
01122                 mdl->push_back( md::create( "ellipsis", "bool" ) );
01123                 reflection = reflection_list::create( ss_type::reflection_get() );
01124                 reflection->push_back( class_reflection::create( "ss_function", mdl ) );
01125         }
01126         return reflection;
01127 }

ptr< object::field_list_list > lestes::lang::cplus::sem::ss_function::field_values_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1129 of file ss_type.g.cc.

References lestes::std::list< T >::create(), and lestes::lang::cplus::sem::ss_type::field_values_get().

Referenced by lestes::lang::cplus::sem::ss_member_function::field_values_get().

01130 {
01131         ptr < field_list_list > result = ss_type::field_values_get();
01132         result->push_back( value_list::create() );
01133         result->back()->push_back( this->instances );
01134         result->push_back( value_list::create() );
01135         result->back()->push_back( this->returns );
01136         result->push_back( value_list::create() );
01137         result->back()->push_back( this->params );
01138         result->push_back( value_list::create() );
01139         result->back()->push_back( objectize< bool > ::create( this->ellipsis ) );
01140         return result;
01141 }

void lestes::lang::cplus::sem::ss_function::gc_mark ( void   )  [protected, virtual]

Marking routine for class ss_function.

Marking routine is used for garbage collection.

Author:
lsg

Reimplemented from lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 1148 of file ss_type.g.cc.

References lestes::lang::cplus::sem::ss_type::gc_mark().

Referenced by lestes::lang::cplus::sem::ss_member_function::gc_mark().

01149 {
01150         ss_type::gc_mark();
01151 }


Member Data Documentation

ptr<::lestes::std::set< srp< ss_function >, ss_function_comparator > > lestes::lang::cplus::sem::ss_function::instances = ::lestes::std::set< srp< ss_function >, ss_function_comparator > ::create() [static, private]

The singleton instances of the class.

Definition at line 753 of file ss_type.g.hh.

srp< ss_type > lestes::lang::cplus::sem::ss_function::returns [private]

The return type of the function.

Definition at line 755 of file ss_type.g.hh.

Referenced by returns_get(), and returns_set().

srp< ::lestes::std::list< srp< ss_type > > > lestes::lang::cplus::sem::ss_function::params [private]

The types of parameters of the function.

Definition at line 757 of file ss_type.g.hh.

Referenced by params_get(), and params_set().

bool lestes::lang::cplus::sem::ss_function::ellipsis [private]

Whether current function has an ellipsis(...) in function parameters.

Rationale for field contra individual class: There is no C++ type, which corresponds to ellipsis.

Definition at line 762 of file ss_type.g.hh.

Referenced by ellipsis_get(), and ellipsis_set().

ptr< object::reflection_list > lestes::lang::cplus::sem::ss_function::reflection = reflection [static, private]

Reimplemented from lestes::lang::cplus::sem::ss_type.

Reimplemented in lestes::lang::cplus::sem::ss_member_function.

Definition at line 763 of file ss_type.g.hh.

Referenced by reflection_get().


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:25:31 2007 for lestes by doxygen 1.5.1-20070107