memory_allocator_bases.g.hh

Go to the documentation of this file.
00001 // This file is automatically generated, do not edit.
00002 
00003 /*!
00004         \file
00005         \brief Base classes for memory allocators.
00006         \author jaz
00007 */
00008 
00009 #ifndef lestes__md__mem__memory_allocator_bases_g_hh__included
00010 #define lestes__md__mem__memory_allocator_bases_g_hh__included
00011 
00012 #include <lestes/md/common.hh>
00013 
00014 #include <lestes/std/objectize_macros.hh>
00015 package(lestes);
00016 package(std);
00017 class object;
00018 end_package(std);
00019 end_package(lestes);
00020 
00021 package(lestes);
00022 package(lang);
00023 package(cplus);
00024 package(sem);
00025 class ss_function_declaration;
00026 end_package(sem);
00027 end_package(cplus);
00028 end_package(lang);
00029 end_package(lestes);
00030 
00031 package(lestes);
00032 package(lang);
00033 package(cplus);
00034 package(sem);
00035 class ss_object_declaration;
00036 end_package(sem);
00037 end_package(cplus);
00038 end_package(lang);
00039 end_package(lestes);
00040 
00041 package(lestes);
00042 package(backend_v2);
00043 package(intercode);
00044 class pi_mem_factory;
00045 end_package(intercode);
00046 end_package(backend_v2);
00047 end_package(lestes);
00048 
00049 package(lestes);
00050 package(backend_v2);
00051 package(intercode);
00052 class pi_abstract_function_call;
00053 end_package(intercode);
00054 end_package(backend_v2);
00055 end_package(lestes);
00056 
00057 package(lestes);
00058 package(md);
00059 package(literals);
00060 class literal_info_base;
00061 end_package(literals);
00062 end_package(md);
00063 end_package(lestes);
00064 
00065 package(lestes);
00066 package(backend_v2);
00067 package(intercode);
00068 class pi_pi;
00069 end_package(intercode);
00070 end_package(backend_v2);
00071 end_package(lestes);
00072 
00073 package(lestes);
00074 package(backend_v2);
00075 package(intercode);
00076 class pi_sp;
00077 end_package(intercode);
00078 end_package(backend_v2);
00079 end_package(lestes);
00080 
00081 package(lestes);
00082 package(md);
00083 package(types);
00084 class tm_data_type_base;
00085 end_package(types);
00086 end_package(md);
00087 end_package(lestes);
00088 
00089 package(lestes);
00090 package(md);
00091 package(mem);
00092 
00093 
00094 class allocator_base;
00095 class local_variable_allocator_base;
00096 class global_variable_allocator_base;
00097 
00098 
00099 /*! \brief Base class for memory allocators.
00100 
00101 Memory allocators allows to allocate variables.
00102 */
00103 class allocator_base : public ::lestes::std::object {
00104 public:
00105         // WARNING: Detailed doxygen description for method
00106         // should be near it's implementation, not in XML file.
00107 
00108         /*! \brief Deallocates previously allocated space.
00109 
00110         Dealocates space occupied by given pi_mem_factory. Point in time, when the dealocation tooks place, is
00111 between psp and nsp sequencepoints.
00112                                         
00113                                 \param mem A memory space to be dealloacated.
00114                                 \param psp A sequencepoint that is set as psp to any generated deallocation code.
00115                                 \param nsp A sequencepoint that is set as nsp to any generated deallocation code.
00116                                 
00117         */
00118         virtual void deallocate(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::backend_v2::intercode::pi_sp > psp, ptr< ::lestes::backend_v2::intercode::pi_sp > nsp) abstract;
00119 
00120         //! Calculates placement of allocated variables.
00121         virtual void calculate_placement() abstract;
00122 
00123         
00124 
00125         //! for purposes of dumping
00126         virtual ptr<reflection_list> reflection_get() const;
00127         //! for purposes of dumping
00128         virtual ptr<field_list_list> field_values_get() const;
00129         
00130 protected:
00131         //! Generated constructor for class allocator_base.
00132         allocator_base (
00133                 );
00134 
00135         //! Marking routine for class allocator_base. 
00136         virtual void gc_mark();
00137 
00138 private:
00139         static ptr<reflection_list> reflection;
00140         
00141 }; // allocator_base
00142 
00143 
00144 /*! \brief Manager for local variable allocation.
00145 
00146 Note: A concrete implementation is target machine-dependent and it is placed in /target/machine/${TARGET_CPU}/lestes/md/memory/ directory.
00147 */
00148 class local_variable_allocator_base : public allocator_base {
00149 public:
00150         //! The method function_get returns the value of the field local_variable_allocator_base::function.
00151         ptr< ::lestes::lang::cplus::sem::ss_function_declaration > function_get() const;
00152 
00153         //! The method function_set sets the field local_variable_allocator_base::function to the given value.
00154         void function_set(const ptr< ::lestes::lang::cplus::sem::ss_function_declaration > &);
00155 
00156         //! Allocates space for variable on the local stack.
00157         virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > allocate(ptr< ::lestes::lang::cplus::sem::ss_object_declaration > decl) abstract;
00158 
00159         //! Allocates space for variable on the local stack.
00160         virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > allocate_tmp(ptr< ::lestes::md::types::tm_data_type_base > type) abstract;
00161 
00162         //! Deallocates space occupied by variable.
00163         virtual void deallocate(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::backend_v2::intercode::pi_sp > psp, ptr< ::lestes::backend_v2::intercode::pi_sp > nsp) abstract;
00164 
00165         //! Calculates placement of local variables and parameters in memory.
00166         virtual void calculate_placement() abstract;
00167 
00168         
00169 
00170         //! for purposes of dumping
00171         virtual ptr<reflection_list> reflection_get() const;
00172         //! for purposes of dumping
00173         virtual ptr<field_list_list> field_values_get() const;
00174         
00175 protected:
00176         //! Generated constructor for class local_variable_allocator_base.
00177         local_variable_allocator_base (
00178                 ptr< ::lestes::lang::cplus::sem::ss_function_declaration > a__local_variable_allocator_base__function);
00179 
00180         //! Marking routine for class local_variable_allocator_base. 
00181         virtual void gc_mark();
00182 
00183 private:
00184         //! Declaration of the function in which's body the allocation is performed.
00185         srp< ::lestes::lang::cplus::sem::ss_function_declaration > function;
00186         static ptr<reflection_list> reflection;
00187         
00188 }; // local_variable_allocator_base
00189 
00190 
00191 /*! \brief Manager for global variable allocation.
00192 
00193 Note: A concrete implementation is target machine-dependent and it is placed in /target/machine/${TARGET_CPU}/lestes/md/memory/ directory.
00194 */
00195 class global_variable_allocator_base : public allocator_base {
00196 public:
00197         //! Allocates space for variable in global data storage.
00198         virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > allocate(ptr< ::lestes::lang::cplus::sem::ss_object_declaration > decl) abstract;
00199 
00200         //! Initialiaze memory space in global data storage with given value.
00201         virtual void init_variable(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::md::literals::literal_info_base > value) abstract;
00202 
00203         //! Deallocates space occupied by variable.
00204         virtual void deallocate(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::backend_v2::intercode::pi_sp > psp, ptr< ::lestes::backend_v2::intercode::pi_sp > nsp) abstract;
00205 
00206         //! Calculates placement of local variables and parameters in memory.
00207         virtual void calculate_placement() abstract;
00208 
00209         
00210 
00211         //! for purposes of dumping
00212         virtual ptr<reflection_list> reflection_get() const;
00213         //! for purposes of dumping
00214         virtual ptr<field_list_list> field_values_get() const;
00215         
00216 protected:
00217         //! Generated constructor for class global_variable_allocator_base.
00218         global_variable_allocator_base (
00219                 );
00220 
00221         //! Marking routine for class global_variable_allocator_base. 
00222         virtual void gc_mark();
00223 
00224 private:
00225         static ptr<reflection_list> reflection;
00226         
00227 }; // global_variable_allocator_base
00228 
00229 
00230 end_package(mem);
00231 end_package(md);
00232 end_package(lestes);
00233 
00234 #endif // lestes__md__mem__memory_allocator_bases_g_hh__included

Generated on Mon Feb 12 18:22:41 2007 for lestes by doxygen 1.5.1-20070107