lestes::lang::cplus::sem::ss_const Class Reference

Class for const types. More...

#include <ss_type.g.hh>

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

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

Public Member Functions

ptr< ss_typewhat_get () const
 The method what_get returns the value of the field ss_const::what.
void what_set (const ptr< ss_type > &)
 The method what_set sets the field ss_const::what to the given value.
virtual bool is_void ()
 Is this type void?
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 > type)
 get the instance representing appropriately qualified argument type
static ptr< ss_constcreate (ptr< ss_type > a__ss_const__what)
 First generated factory method for class ss_const.

Protected Member Functions

 ss_const (ptr< ss_type > a__ss_const__what)
 Generated constructor for class ss_const.
virtual void gc_mark ()
 Marking routine for class ss_const.

Private Attributes

srp< ss_typewhat

Static Private Attributes

static ptr< ::lestes::std::map<
srp< ss_type >, srp< ss_type > > > 
the_instances = ::lestes::std::map< srp< ss_type >, srp< ss_type > > ::create()
 holder for the class instances
static ptr< reflection_listreflection = reflection

Detailed Description

Class for const types.

Singleton class.

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


Constructor & Destructor Documentation

lestes::lang::cplus::sem::ss_const::ss_const ( ptr< ss_type a__ss_const__what  )  [protected]

Generated constructor for class ss_const.

Generated constructor for class ss_const.

Author:
lsg

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

Referenced by create().

00170         : ss_type(), what(checked(a__ss_const__what))
00171 {}


Member Function Documentation

ptr< ss_type > lestes::lang::cplus::sem::ss_const::what_get (  )  const

The method what_get returns the value of the field ss_const::what.

Returns:
The value of ss_const::what.
Author:
lsg

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

References what.

00123 {
00124         return what;
00125 }

void lestes::lang::cplus::sem::ss_const::what_set ( const ptr< ss_type > &  x  ) 

The method what_set sets the field ss_const::what to the given value.

Parameters:
[in] x The new value to set ss_const::what to.
Author:
lsg

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

References what.

00132 {
00133         ss_const::what = x;
00134 }

bool lestes::lang::cplus::sem::ss_const::is_void (  )  [virtual]

Is this type void?

Used for genarating pi calls. Differentiate between call and callv. Generic case returns false;

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

Definition at line 77 of file ss_type.cc.

References what.

00078 {
00079         return what->is_void();
00080 }

ptr< ss_type > lestes::lang::cplus::sem::ss_const::instance ( ptr< ss_type x  )  [static]

get the instance representing appropriately qualified argument type

Returns constized version of a given type. The constization is an idempotent operation. Constization and volatilization is commutative.

Precondition:
x != NULL
Parameters:
x The type to make const.
Returns:
The constized type.

Definition at line 144 of file ss_type.cc.

References lestes::intercode::intercode::create(), lestes::lang::cplus::sem::ss_type2info::create(), lassert, lestes::lang::cplus::sem::ss_type2info::SS_CONST, lestes::lang::cplus::sem::ss_type2info::SS_CONST_VOLATILE, lestes::lang::cplus::sem::ss_type2info::SS_VOLATILE, and the_instances.

Referenced by lestes::lang::cplus::sem::or_builtin_operator_declaration_creator::add_ref_ptr_const(), and lestes::lang::cplus::sem::ss_volatile::instance().

00145 {
00146         the_instances->dump_barrier_set(true); // XXX: needed just once :-I
00147 
00148         lassert(x);
00149         srp<ss_type> &result = (*the_instances)[x];
00150 
00151         if (result)
00152                 return result;
00153 
00154         ptr<ss_type2info> ssti = ss_type2info::create();
00155 
00156         switch (ssti->process(x)) {
00157                 case ss_type2info::SS_CONST:
00158                 case ss_type2info::SS_CONST_VOLATILE:
00159                         return result = x;
00160                 case ss_type2info::SS_VOLATILE:
00161                         // this is the only place to create const_volatile
00162                         return result = ss_const_volatile::create(ssti->ss_volatile_object_get()->what_get());
00163                 default:
00164                         break;
00165         }
00166         
00167         return result = ss_const::create(x);
00168 }

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

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

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

00137 {
00138         return v->visit_ss_const( this );
00139 }

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

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

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

00142 {
00143         return v->visit_ss_const( this );
00144 }

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

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

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

00147 {
00148         return v->visit_ss_const( this );
00149 }

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

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

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

00152 {
00153         return v->visit_ss_const( this );
00154 }

ptr< ss_const > lestes::lang::cplus::sem::ss_const::create ( ptr< ss_type a__ss_const__what  )  [static]

First generated factory method for class ss_const.

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

Author:
lsg

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

References ss_const().

00161 {
00162         return ptr< ss_const > ( new ss_const(a__ss_const__what) );
00163 }

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

for purposes of dumping

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

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

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

00174 {
00175         if (!reflection) {
00176                 typedef class_reflection::field_metadata md;
00177                 typedef class_reflection::field_metadata_list mdlist;
00178                 ptr<mdlist> mdl = mdlist::create();
00179                 mdl->push_back( md::create( "what", "ss_type" ) );
00180                 mdl->push_back( md::create( "the_instances", "map&lt; srp&lt; ss_type &gt;, srp&lt; ss_type &gt; &gt;" ) );
00181                 reflection = reflection_list::create( ss_type::reflection_get() );
00182                 reflection->push_back( class_reflection::create( "ss_const", mdl ) );
00183         }
00184         return reflection;
00185 }

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

for purposes of dumping

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

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

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

00188 {
00189         ptr < field_list_list > result = ss_type::field_values_get();
00190         result->push_back( value_list::create() );
00191         result->back()->push_back( this->what );
00192         result->push_back( value_list::create() );
00193         result->back()->push_back( this->the_instances );
00194         return result;
00195 }

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

Marking routine for class ss_const.

Marking routine is used for garbage collection.

Author:
lsg

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

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

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

00203 {
00204         ss_type::gc_mark();
00205 }


Member Data Documentation

srp< ss_type > lestes::lang::cplus::sem::ss_const::what [private]

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

Referenced by is_void(), what_get(), and what_set().

ptr<::lestes::std::map< srp< ss_type >, srp< ss_type > > > lestes::lang::cplus::sem::ss_const::the_instances = ::lestes::std::map< srp< ss_type >, srp< ss_type > > ::create() [static, private]

holder for the class instances

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

Referenced by instance().

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

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

Definition at line 209 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:30 2007 for lestes by doxygen 1.5.1-20070107