Ignore:
Timestamp:
Jul 12, 2007, 2:58:26 AM (17 years ago)
Author:
dai_9181
Message:

コード全体のリファクタリングを実施

File:
1 edited

Legend:

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

    r193 r206  
    44#include <string>
    55
    6 #include <jenga/include/smoothie/Type.h>
    76#include <jenga/include/smoothie/Namespace.h>
     7
     8#include <Type.h>
     9#include <Symbol.h>
    810
    911using namespace std;
     
    1113class TypeDefCollection;
    1214
    13 class TypeDef{
     15class TypeDef : public Symbol
     16{
    1417    friend TypeDefCollection;
    1518
    16     NamespaceScopes namespaceScopes;
    17 
    18     string name;
    1919    string baseName;
    2020    Type baseType;
     21
     22    // XMLシリアライズ用
     23private:
     24    friend class boost::serialization::access;
     25    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     26    {
     27        trace_for_serialize( "serializing - TypeDef" );
     28
     29        ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
     30        ar & BOOST_SERIALIZATION_NVP( baseName );
     31        ar & BOOST_SERIALIZATION_NVP( baseType );
     32    }
     33
    2134public:
    2235    TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
    23     ~TypeDef();
     36    TypeDef()
     37    {
     38    }
     39    ~TypeDef()
     40    {
     41    }
    2442
    25     const string &GetName() const
    26     {
    27         return name;
    28     }
    2943    const string &GetBaseName() const
    3044    {
     
    3549        return baseType;
    3650    }
    37 
    38     bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
    39     bool IsEqualSymbol( const string &name ) const;
    4051};
    4152
    42 class TypeDefCollection : public vector<TypeDef>
     53class TypeDefCollection : public std::vector<TypeDef>
    4354{
     55    // XMLシリアライズ用
     56private:
     57    friend class boost::serialization::access;
     58    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     59    {
     60        trace_for_serialize( "serializing - TypeDefCollection" );
     61
     62        ar & boost::serialization::make_nvp("vector_TypeDef",
     63            boost::serialization::base_object<std::vector<TypeDef>>(*this));
     64    }
     65
    4466public:
    4567    TypeDefCollection();
Note: See TracChangeset for help on using the changeset viewer.