Ignore:
Timestamp:
Apr 30, 2008, 8:38:09 PM (16 years ago)
Author:
dai_9181
Message:

Interfaceクラスを独自ファイルにした。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common/include
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h

    r511 r513  
    33#include <option.h>
    44#include <Program.h>
    5 #include <Type.h>
    6 #include <Method.h>
    75#include <Member.h>
    86#include <Source.h>
    97
    108class UserProc;
    11 class CClass;
    129class Delegate;
    13 
    14 class DynamicMethodsPrototype
    15 {
    16     // 動的メソッド
    17     Methods dynamicMethods;
    18 
    19     // XMLシリアライズ用
    20 private:
    21     friend class boost::serialization::access;
    22     template<class Archive> void serialize(Archive& ar, const unsigned int version)
    23     {
    24         ar & BOOST_SERIALIZATION_NVP( dynamicMethods );
    25     }
    26 
    27 public:
    28     DynamicMethodsPrototype(){}
    29     DynamicMethodsPrototype( const DynamicMethodsPrototype &dynamicMethodsPrototype )
    30         : dynamicMethods( dynamicMethodsPrototype.dynamicMethods )
    31     {
    32     }
    33     ~DynamicMethodsPrototype(){}
    34 
    35     const Methods &GetDynamicMethods() const
    36     {
    37         return dynamicMethods;
    38     }
    39     Methods &GetDynamicMethods()
    40     {
    41         return dynamicMethods;
    42     }
    43 
    44     void AddDynamicMethods( CMethod *pMethod )
    45     {
    46         dynamicMethods.push_back( pMethod );
    47     }
    48 };
    4910
    5011class ClassPrototype : public Prototype, public DynamicMethodsPrototype
     
    7132    }
    7233};
    73 
    74 class Interface : public DynamicMethodsPrototype
    75 {
    76     const CClass *pInterfaceClass;
    77     mutable LONG_PTR vtblOffset;
    78 
    79     // 型パラメータ(実パラメータ)
    80     Types actualTypeParameters;
    81 
    82     // XMLシリアライズ用
    83 private:
    84     friend class boost::serialization::access;
    85     template<class Archive> void serialize(Archive& ar, const unsigned int version)
    86     {
    87         trace_for_serialize( "serializing - Interface" );
    88 
    89         ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
    90         ar & boost::serialization::make_nvp("pInterfaceClass", const_cast<CClass *&>(pInterfaceClass) );
    91         ar & BOOST_SERIALIZATION_NVP( vtblOffset );
    92         ar & BOOST_SERIALIZATION_NVP( actualTypeParameters );
    93     }
    94 
    95 public:
    96     Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters );
    97     Interface( const Interface &objInterface )
    98         : DynamicMethodsPrototype( objInterface )
    99         , pInterfaceClass( objInterface.pInterfaceClass )
    100         , vtblOffset( objInterface.vtblOffset )
    101     {
    102     }
    103     Interface()
    104     {
    105     }
    106 
    107     const CClass &GetClass() const{
    108         return *pInterfaceClass;
    109     }
    110     LONG_PTR GetVtblOffset() const
    111     {
    112         return vtblOffset;
    113     }
    114     void SetVtblOffset( LONG_PTR vtblOffset ) const
    115     {
    116         this->vtblOffset = vtblOffset;
    117     }
    118 
    119     const Types &GetActualTypeParameters() const
    120     {
    121         return actualTypeParameters;
    122     }
    123 
    124     std::string GetFullNameWithActualGenericTypeParameters() const;
    125 };
    126 typedef std::vector<Interface *> Interfaces;
    12734
    12835class CClass: public ClassPrototype, public Jenga::Common::ObjectInHashmap<CClass>
Note: See TracChangeset for help on using the changeset viewer.