Changeset 344 in dev for trunk/abdev/BasicCompiler_Common


Ignore:
Timestamp:
Oct 9, 2007, 11:37:45 PM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/abdev/BasicCompiler_Common
Files:
2 edited

Legend:

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

    r343 r344  
    1212class Delegate;
    1313
    14 class ClassPrototype : public Prototype
     14class DynamicMethodsPrototype
    1515{
    1616    // 動的メソッド
     
    2222    template<class Archive> void serialize(Archive& ar, const unsigned int version)
    2323    {
     24        ar & BOOST_SERIALIZATION_NVP( dynamicMethods );
     25    }
     26
     27public:
     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};
     49
     50class ClassPrototype : public Prototype, public DynamicMethodsPrototype
     51{
     52    // XMLシリアライズ用
     53private:
     54    friend class boost::serialization::access;
     55    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     56    {
    2457        ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Prototype );
    25         ar & BOOST_SERIALIZATION_NVP( dynamicMethods );
     58        ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
    2659    }
    2760
     
    2962    ClassPrototype( const NamespaceScopes &namespaceScopes, const string &name )
    3063        : Prototype( namespaceScopes, name )
     64        , DynamicMethodsPrototype()
    3165    {
    3266    }
    3367    ClassPrototype()
    3468        : Prototype()
    35     {
    36     }
    37     const Methods &GetDynamicMethods() const
    38     {
    39         return dynamicMethods;
    40     }
    41     Methods &GetDynamicMethods()
    42     {
    43         return dynamicMethods;
     69        , DynamicMethodsPrototype()
     70    {
    4471    }
    4572};
    4673
    47 class Interface : public ClassPrototype
     74class Interface : public DynamicMethodsPrototype
    4875{
    4976    const CClass *pInterfaceClass;
    5077    mutable int vtblOffset;
     78
    5179public:
    5280    Interface( const CClass *pInterfaceClass );
     81    Interface( const Interface &objInterface )
     82        : DynamicMethodsPrototype( objInterface )
     83        , pInterfaceClass( objInterface.pInterfaceClass )
     84        , vtblOffset( objInterface.vtblOffset )
     85    {
     86    }
    5387
    5488    const CClass &GetClass() const{
  • trunk/abdev/BasicCompiler_Common/src/Class.cpp

    r343 r344  
    7777
    7878Interface::Interface( const CClass *pInterfaceClass )
    79     : pInterfaceClass( pInterfaceClass )
     79    : DynamicMethodsPrototype()
     80    , pInterfaceClass( pInterfaceClass )
    8081    , vtblOffset( -1 )
    8182{
     
    102103        }
    103104
    104         GetDynamicMethods().push_back( pMethod );
     105        AddDynamicMethods( pMethod );
    105106    }
    106107}
Note: See TracChangeset for help on using the changeset viewer.