Changeset 190 in dev for trunk/jenga/include


Ignore:
Timestamp:
Jun 26, 2007, 12:05:36 AM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/jenga/include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/jenga/include/common/BoostXmlSupport.h

    r189 r190  
    88#include <boost/archive/xml_oarchive.hpp>
    99#include <boost/archive/xml_iarchive.hpp>
     10#include <boost/serialization/serialization.hpp>
     11#include <boost/serialization/string.hpp>
     12#include <boost/serialization/access.hpp>
     13#include <boost/serialization/export.hpp>
     14#include <boost/serialization/level.hpp>
     15#include <boost/serialization/vector.hpp>
     16#include <boost/serialization/map.hpp>
     17#include <boost/serialization/nvp.hpp>
     18#include <boost/serialization/version.hpp>
     19#include <boost/serialization/is_abstract.hpp>
    1020
    1121namespace Jenga{
  • trunk/jenga/include/smoothie/Class.h

    r181 r190  
    11#pragma once
     2
     3#include <jenga/include/common/BoostXmlSupport.h>
    24
    35#include "Prototype.h"
     
    8385
    8486    CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name );
     87    CClass()
     88        : Prototype()
     89    {
     90    }
    8591    ~CClass();
    8692
     
    259265    CClass *pobj_NextClass;
    260266
    261 
     267    // XMLシリアライズ用
     268private:
     269    friend class boost::serialization::access;
     270    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     271    {
     272        ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Prototype );
     273        ar & BOOST_SERIALIZATION_NVP( classType );
     274    }
     275
     276
     277public:
    262278    static bool SplitName( const char *desc, char *object, char *member, CClass::RefType &refType ){
    263279        int lastIndex = -1;
     
    305321class Classes
    306322{
    307     int hash(const char *name) const;
     323    int GetHashCode(const char *name) const;
    308324    void DestroyClass(CClass *pobj_c);
    309325public:
     
    318334
    319335    virtual CClass *Create( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name) = 0;
     336    bool Insert( CClass *pClass );
    320337    CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
    321338
     
    360377    /////////////////////
    361378private:
    362     CClass **ppobj_IteClass;
    363     int iIteMaxNum;
    364     int iIteNextNum;
    365 public:
    366     void Iterator_Init(void);
    367     void Iterator_Reset(void);
    368     BOOL Iterator_HasNext(void);
    369     CClass *Iterator_GetNext(void);
    370     int Iterator_GetMaxCount(void);
     379    mutable CClass **ppobj_IteClass;
     380    mutable int iIteMaxNum;
     381    mutable int iIteNextNum;
     382public:
     383    void Iterator_Init() const;
     384    void Iterator_Reset() const;
     385    BOOL Iterator_HasNext() const;
     386    CClass *Iterator_GetNext() const;
     387    int Iterator_GetMaxCount() const;
    371388};
  • trunk/jenga/include/smoothie/ObjectModule.h

    r187 r190  
    11#pragma once
    2 
    3 #include <jenga/include/common/BoostXmlSupport.h>
    42
    53#include "TypeDef.h"
     
    97
    108// プロジェクト中に存在するメタ情報
    11 class Meta : public Jenga::Common::BoostXmlSupport<Meta>
     9class Meta
    1210{
    13     Classes *pClasses;
    1411    ProcPointers *pProcPointers;
    1512public:
    1613
    17     Meta( Classes *pNewClasses, ProcPointers *pNewProcPointers )
    18         : pClasses( pNewClasses )
    19         , pProcPointers( pNewProcPointers )
     14    Meta( ProcPointers *pNewProcPointers )
     15        : pProcPointers( pNewProcPointers )
     16    {
     17    }
     18    Meta()
    2019    {
    2120    }
    2221    ~Meta()
    2322    {
    24         delete pClasses;
    2523        delete pProcPointers;
    2624    }
     
    3028
    3129    // クラス
    32     Classes &GetClasses()
    33     {
    34         return *pClasses;
    35     }
    36     void SetClasses( Classes *pClasses )
    37     {
    38         this->pClasses = pClasses;
    39     }
     30    virtual Classes &GetClasses() = 0;
     31    virtual void SetClasses( Classes *pClasses ) = 0;
     32    virtual bool AutoWrite( const std::string &filePath ) = 0;
    4033
    4134    // TypeDef
     
    5346    // XMLシリアライズ用
    5447private:
    55     virtual const char *RootTagName() const
    56     {
    57         return "meta";
    58     }
    5948    friend class boost::serialization::access;
    6049    template<class Archive> void serialize(Archive& ar, const unsigned int version)
    6150    {
    62         //ar & BOOST_SERIALIZATION_NVP( pClasses );
    6351    }
    6452};
    65 
    66 
    67 #define DEF_XML_SCHEMA( node ) BOOST_CLASS_IMPLEMENTATION( node, boost::serialization::object_serializable );
    68 
    69 // ノード クラスを追加したらここでも定義する
    70 DEF_XML_SCHEMA( Meta )
    71 
    72 #undef DEF_XML_SCHEMA
  • trunk/jenga/include/smoothie/Prototype.h

    r170 r190  
    44#include <vector>
    55
    6 #include "Namespace.h"
     6#include <jenga/include/common/BoostXmlSupport.h>
     7
     8#include "Symbol.h"
    79
    810using namespace std;
     
    1113class UserProc;
    1214
    13 class Prototype
     15class Prototype : public Symbol
    1416{
    1517public:
     
    2224
    2325private:
    24     // 名前空間
    25     NamespaceScopes namespaceScopes;
    26 
    27     //名前
    28     string name;
    29 
    3026    mutable bool isUsing;
    3127
     
    3329
    3430    Prototype( const NamespaceScopes &namespaceScopes, const string &name )
    35         : namespaceScopes( namespaceScopes )
    36         , name( name )
     31        : Symbol( namespaceScopes, name )
    3732        , isUsing( false )
     33    {
     34    }
     35    Prototype()
     36        : Symbol()
    3837    {
    3938    }
    4039    ~Prototype()
    4140    {
    42     }
    43 
    44     // 名前空間
    45     const NamespaceScopes &GetNamespaceScopes() const
    46     {
    47         return namespaceScopes;
    48     }
    49 
    50     const string &GetName() const
    51     {
    52         return name;
    5341    }
    5442
     
    7563    {
    7664        isUsing = true;
     65    }
     66
     67    // XMLシリアライズ用
     68private:
     69    friend class boost::serialization::access;
     70    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     71    {
     72        ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
    7773    }
    7874
  • trunk/jenga/include/smoothie/Smoothie.h

    r181 r190  
    77class Smoothie{
    88    static bool isUnicode;
    9 
    10     static Meta meta;
    119public:
    1210
     
    2018    }
    2119
    22     static Meta &GetMeta()
    23     {
    24         return meta;
    25     }
     20    static Meta &GetMeta();
    2621
    2722    class Lexical{
  • trunk/jenga/include/smoothie/Symbol.h

    r170 r190  
    33#include <vector>
    44#include <string>
     5
     6#include <jenga/include/common/BoostXmlSupport.h>
    57
    68#include "Namespace.h"
     
    2022    Symbol( const char *fullName );
    2123    Symbol( const string &fullName );
     24    Symbol()
     25    {
     26    }
    2227
    2328    const NamespaceScopes &GetNamespaceScopes() const
     
    2934        return name;
    3035    }
     36
     37private:
     38    friend class boost::serialization::access;
     39    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     40    {
     41        //ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
     42        ar & BOOST_SERIALIZATION_NVP( name );
     43    }
    3144};
Note: See TracChangeset for help on using the changeset viewer.