lestes::lang::cplus::sem::ss_destructor_table Class Reference

#include <ss_ss2pi_base.g.hh>

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

lestes::std::object lestes::std::mem::keystone List of all members.

Public Member Functions

ptr< ss_compound_stmtcompound_stmt_get () const
 The method compound_stmt_get returns the value of the field ss_destructor_table::compound_stmt.
void compound_stmt_set (const ptr< ss_compound_stmt > &)
 The method compound_stmt_set sets the field ss_destructor_table::compound_stmt to the given value.
ptr< ::lestes::std::list<
srp< destructor_entry_type > > > 
destructors_get () const
 The method destructors_get returns the value of the field ss_destructor_table::destructors.
void destructors_set (const ptr< ::lestes::std::list< srp< destructor_entry_type > > > &)
 The method destructors_set sets the field ss_destructor_table::destructors to the given value.
void destructor_add (ptr< ss_function_declaration >, ptr< ::lestes::backend_v2::intercode::pi_mem_factory >)
virtual ptr< ::lestes::backend_v2::intercode::pi_spback_roll_table (ptr< ::lestes::backend_v2::intercode::pi_sp > psp, ptr< ::lestes::backend_v2::intercode::pi_sp > nsp)
 Implements back rolling of a destructor table (i.e.compound statement).
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_destructor_tablecreate (ptr< ss_compound_stmt > a__ss_destructor_table__compound_stmt, ptr< ::lestes::std::list< srp< destructor_entry_type > > > a__ss_destructor_table__destructors)
 First generated factory method for class ss_destructor_table.
static ptr< ss_destructor_tablecreate (ptr< ss_compound_stmt > a__ss_destructor_table__compound_stmt)
 Second generated factory method for class ss_destructor_table.

Protected Member Functions

 ss_destructor_table (ptr< ss_compound_stmt > a__ss_destructor_table__compound_stmt, ptr< ::lestes::std::list< srp< destructor_entry_type > > > a__ss_destructor_table__destructors)
 Generated constructor for class ss_destructor_table.
virtual void gc_mark ()
 Marking routine for class ss_destructor_table.

Private Attributes

srp< ss_compound_stmtcompound_stmt
 Compound statement, where variable (destructor) takes place.
srp< ::lestes::std::list<
srp< destructor_entry_type > > > 
destructors

Static Private Attributes

static ptr< reflection_listreflection = reflection

Detailed Description

Definition at line 669 of file ss_ss2pi_base.g.hh.


Constructor & Destructor Documentation

lestes::lang::cplus::sem::ss_destructor_table::ss_destructor_table ( ptr< ss_compound_stmt a__ss_destructor_table__compound_stmt,
ptr< ::lestes::std::list< srp< destructor_entry_type > > >  a__ss_destructor_table__destructors 
) [protected]

Generated constructor for class ss_destructor_table.

Generated constructor for class ss_destructor_table.

Author:
lsg

Definition at line 788 of file ss_ss2pi_base.g.cc.

Referenced by create().

00790         : object(), compound_stmt(a__ss_destructor_table__compound_stmt), destructors(checked(a__ss_destructor_table__destructors))
00791 {}


Member Function Documentation

ptr< ss_compound_stmt > lestes::lang::cplus::sem::ss_destructor_table::compound_stmt_get (  )  const

The method compound_stmt_get returns the value of the field ss_destructor_table::compound_stmt.

Returns:
The value of ss_destructor_table::compound_stmt.
Author:
lsg

Definition at line 732 of file ss_ss2pi_base.g.cc.

References compound_stmt.

00733 {
00734         return compound_stmt;
00735 }

void lestes::lang::cplus::sem::ss_destructor_table::compound_stmt_set ( const ptr< ss_compound_stmt > &  x  ) 

The method compound_stmt_set sets the field ss_destructor_table::compound_stmt to the given value.

Parameters:
[in] x The new value to set ss_destructor_table::compound_stmt to.
Author:
lsg

Definition at line 741 of file ss_ss2pi_base.g.cc.

References compound_stmt.

00742 {
00743         ss_destructor_table::compound_stmt = x;
00744 }

ptr<::lestes::std::list< srp< destructor_entry_type > > > lestes::lang::cplus::sem::ss_destructor_table::destructors_get (  )  const

The method destructors_get returns the value of the field ss_destructor_table::destructors.

Returns:
The value of ss_destructor_table::destructors.
Author:
lsg

Definition at line 750 of file ss_ss2pi_base.g.cc.

References destructors.

Referenced by back_roll_table().

00751 {
00752         return destructors;
00753 }

void lestes::lang::cplus::sem::ss_destructor_table::destructors_set ( const ptr< ::lestes::std::list< srp< destructor_entry_type > > > &  x  ) 

The method destructors_set sets the field ss_destructor_table::destructors to the given value.

Parameters:
[in] x The new value to set ss_destructor_table::destructors to.
Author:
lsg

Definition at line 759 of file ss_ss2pi_base.g.cc.

References destructors.

00760 {
00761         ss_destructor_table::destructors = x;
00762 }

void lestes::lang::cplus::sem::ss_destructor_table::destructor_add ( ptr< ss_function_declaration x,
ptr< ::lestes::backend_v2::intercode::pi_mem_factory y 
)

Adds destructor to destructor table. It expect appropriate destructor to memmory placeholder (namely NULL for builtin types).

Definition at line 1721 of file ss_ss2pi_base.cc.

References lestes::std::pair< T1, T2 >::create(), destructors, plog, and lestes::std::object::uid_get().

01721                                                                                                                             {
01722         plog(dtl) << "Table " << this->uid_get()<< " : added "<< y->uid_get() << "\n";
01723         destructors->push_back(destructor_entry_type::create(x,y));
01724 }

ptr<::lestes::backend_v2::intercode::pi_sp > lestes::lang::cplus::sem::ss_destructor_table::back_roll_table ( ptr< ::lestes::backend_v2::intercode::pi_sp psp,
ptr< ::lestes::backend_v2::intercode::pi_sp nsp 
) [virtual]

Implements back rolling of a destructor table (i.e.compound statement).

Implements back rolling of a given destructor table (i.e. usually compound statement). Accepts pseudoinstruction sequence points, between which pastes destructor calls and dealocation routines. psp and nsp of a given sequence points will change.

Returns last sequence point, which has nsp set to nsp argument of function. (i.e. there is no instruction between returned sp and given psp) So than can be recursive continuation in other compound statements.

Definition at line 1790 of file ss_ss2pi_base.cc.

References destructors_get(), lestes::msg::eolog, plog, and lestes::std::object::uid_get().

01790                                                                                                                                                               {
01791 plog(dtl) << "table back roll " << this->uid_get()<<" [ psp: "<<psp->uid_get()<< " nsp: " <<nsp->uid_get()<<"]\n" <<eolog;; 
01792 
01793         ptr< pi_sp > last_sp = psp;
01794         list < srp < destructor_entry_type > >::reverse_iterator i = this->destructors_get()->rbegin();
01795         for(; i != this->destructors_get()->rend() ; i++ ){
01796                 
01797                 ptr< pi_sp > new_sp = pi_sp::create (last_sp,nsp,nsp->level_get());
01798                 last_sp->nsp_set(new_sp);
01799                 backend_data_builder::instance()->add_sp(new_sp);
01800 
01801                 if ((*i)->first){                       //exists destructor function
01802                         //TODO  when classes are implemented, destructor shall be called here
01803                 }//if
01804                 
01805                 plog(dtl) << "Table " << this->uid_get() << " : destruct " << (*i)->second->uid_get() <<"\n";
01806                 plog(spl) << "  SP: destr pi_sp added : " <<new_sp->uid_get() << "\n" <<eolog;
01807         
01808                 mem_alloc_manager::instance()->deallocate((*i)->second,last_sp,new_sp);
01809                 last_sp=new_sp;
01810         }//for
01811         
01812         last_sp->nsp_set(nsp);
01813         nsp->psp_set(last_sp);
01814         return last_sp;
01815 }

ptr< ss_destructor_table > lestes::lang::cplus::sem::ss_destructor_table::create ( ptr< ss_compound_stmt a__ss_destructor_table__compound_stmt,
ptr< ::lestes::std::list< srp< destructor_entry_type > > >  a__ss_destructor_table__destructors 
) [static]

First generated factory method for class ss_destructor_table.

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

Author:
lsg

Definition at line 768 of file ss_ss2pi_base.g.cc.

References ss_destructor_table().

Referenced by create(), and lestes::lang::cplus::sem::ss_destructor_tables_stack::open_compound_stmt().

00770 {
00771         return ptr< ss_destructor_table > ( new ss_destructor_table(a__ss_destructor_table__compound_stmt,
00772                 a__ss_destructor_table__destructors) );
00773 }

ptr< ss_destructor_table > lestes::lang::cplus::sem::ss_destructor_table::create ( ptr< ss_compound_stmt a__ss_destructor_table__compound_stmt  )  [static]

Second generated factory method for class ss_destructor_table.

This factory method for class ss_destructor_table uses initializers.

Author:
lsg

Definition at line 779 of file ss_ss2pi_base.g.cc.

References create(), and ss_destructor_table().

00780 {
00781         return ptr< ss_destructor_table > ( new ss_destructor_table(a__ss_destructor_table__compound_stmt, ::lestes::std::list< srp< destructor_entry_type > > ::create()) );
00782 }

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

for purposes of dumping

Reimplemented from lestes::std::object.

Definition at line 793 of file ss_ss2pi_base.g.cc.

References lestes::std::list< T >::create(), reflection, and lestes::std::object::reflection_get().

00794 {
00795         if (!reflection) {
00796                 typedef class_reflection::field_metadata md;
00797                 typedef class_reflection::field_metadata_list mdlist;
00798                 ptr<mdlist> mdl = mdlist::create();
00799                 mdl->push_back( md::create( "compound_stmt", "ss_compound_stmt" ) );
00800                 mdl->push_back( md::create( "destructors", "list&lt; srp&lt; destructor_entry_type &gt; &gt;" ) );
00801                 reflection = reflection_list::create( ::lestes::std::object::reflection_get() );
00802                 reflection->push_back( class_reflection::create( "ss_destructor_table", mdl ) );
00803         }
00804         return reflection;
00805 }

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

for purposes of dumping

Reimplemented from lestes::std::object.

Definition at line 807 of file ss_ss2pi_base.g.cc.

References lestes::std::list< T >::create(), and lestes::std::object::field_values_get().

00808 {
00809         ptr < field_list_list > result = ::lestes::std::object::field_values_get();
00810         result->push_back( value_list::create() );
00811         result->back()->push_back( this->compound_stmt );
00812         result->push_back( value_list::create() );
00813         result->back()->push_back( this->destructors );
00814         return result;
00815 }

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

Marking routine for class ss_destructor_table.

Marking routine is used for garbage collection.

Author:
lsg

Reimplemented from lestes::std::mem::keystone.

Definition at line 822 of file ss_ss2pi_base.g.cc.

References lestes::std::mem::keystone::gc_mark().

00823 {
00824 	::lestes::std::object::gc_mark();
00825 }


Member Data Documentation

srp< ss_compound_stmt > lestes::lang::cplus::sem::ss_destructor_table::compound_stmt [private]

Compound statement, where variable (destructor) takes place.

Definition at line 716 of file ss_ss2pi_base.g.hh.

Referenced by compound_stmt_get(), and compound_stmt_set().

srp< ::lestes::std::list< srp< destructor_entry_type > > > lestes::lang::cplus::sem::ss_destructor_table::destructors [private]

For types, which have no destructors, destructor set to NULL.

Definition at line 720 of file ss_ss2pi_base.g.hh.

Referenced by destructor_add(), destructors_get(), and destructors_set().

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

Reimplemented from lestes::std::object.

Definition at line 721 of file ss_ss2pi_base.g.hh.

Referenced by reflection_get().


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