Changeset 203 in dev for trunk/jenga
- Timestamp:
- Jul 3, 2007, 3:49:18 AM (17 years ago)
- Location:
- trunk/jenga
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jenga/include/smoothie/Class.h
r200 r203 54 54 NamespaceScopesCollection importedNamespaces; 55 55 56 // 継承するインターフェイス56 // 実装するインターフェイス 57 57 Interfaces interfaces; 58 59 // 継承クラス 60 const CClass *pSuperClass; 58 61 59 62 // Blittable型情報 … … 77 80 78 81 // XMLシリアライズ用 82 // TODO: xml実装 79 83 private: 80 84 friend class boost::serialization::access; … … 85 89 ar & BOOST_SERIALIZATION_NVP( importedNamespaces ); 86 90 //ar & BOOST_SERIALIZATION_NVP( interfaces ); 91 ar & boost::serialization::make_nvp( "pSuperClass", const_cast<CClass *&>(pSuperClass) ); 87 92 ar & BOOST_SERIALIZATION_NVP( blittableType ); 88 93 //ar & BOOST_SERIALIZATION_NVP( dynamicMembers ); … … 99 104 100 105 public: 101 //継承クラスへのポインタ102 const CClass *pobj_InheritsClass;103 106 104 107 //アラインメント値 105 108 int iAlign; 106 109 107 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name ); 110 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name ) 111 : isReady( false ) 112 , Prototype( namespaceScopes, name ) 113 , importedNamespaces( importedNamespaces ) 114 , ConstructorMemberSubIndex( -1 ) 115 , DestructorMemberSubIndex( -1 ) 116 , classType( Class ) 117 , pSuperClass( NULL ) 118 , vtblNum( 0 ) 119 , iAlign( 0 ) 120 , vtbl_offset( -1 ) 121 , isCompilingConstructor( false ) 122 , isCompilingDestructor( false ) 123 , pobj_NextClass( NULL ) 124 { 125 } 108 126 CClass() 109 : Prototype() 127 : isReady( false ) 128 , Prototype() 129 , importedNamespaces() 130 , ConstructorMemberSubIndex( -1 ) 131 , DestructorMemberSubIndex( -1 ) 132 , classType() 133 , pSuperClass( NULL ) 134 , vtblNum( 0 ) 135 , iAlign( 0 ) 136 , vtbl_offset( -1 ) 137 , isCompilingConstructor( false ) 138 , isCompilingDestructor( false ) 139 , pobj_NextClass( NULL ) 110 140 { 111 141 } … … 130 160 } 131 161 bool IsInheritsInterface( const CClass *pInterfaceClass ) const; 162 163 // 継承元クラス 164 bool HasSuperClass() const 165 { 166 return ( pSuperClass != NULL ); 167 } 168 const CClass &GetSuperClass() const 169 { 170 return *pSuperClass; 171 } 172 void SetSuperClass( const CClass *pSuperClass ) 173 { 174 this->pSuperClass = pSuperClass; 175 } 132 176 133 177 // Blittable型 -
trunk/jenga/include/smoothie/Member.h
r187 r203 20 20 string initializeExpression; 21 21 string constructParameter; 22 23 // XMLシリアライズ用 24 private: 25 friend class boost::serialization::access; 26 template<class Archive> void serialize(Archive& ar, const unsigned int version) 27 { 28 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( MemberPrototype ); 29 ar & BOOST_SERIALIZATION_NVP( name ); 30 ar & BOOST_SERIALIZATION_NVP( type ); 31 ar & BOOST_SERIALIZATION_NVP( isConst ); 32 ar & BOOST_SERIALIZATION_NVP( initializeExpression ); 33 ar & BOOST_SERIALIZATION_NVP( constructParameter ); 34 } 35 22 36 public: 23 37 int SubScripts[MAX_ARRAYDIM]; -
trunk/jenga/include/smoothie/Method.h
r170 r203 17 17 class CMethod : public MemberPrototype 18 18 { 19 20 // XMLシリアライズ用 21 // TODO: xml実装 22 private: 23 friend class boost::serialization::access; 24 template<class Archive> void serialize(Archive& ar, const unsigned int version) 25 { 26 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( MemberPrototype ); 27 //ar & BOOST_SERIALIZATION_NVP( pUserProc ); 28 } 29 19 30 public: 20 31 UserProc *pUserProc; … … 41 52 bool isConst; 42 53 const CClass *pInheritsClass; 54 55 // XMLシリアライズ用 56 // TODO: xml実装 57 private: 58 friend class boost::serialization::access; 59 template<class Archive> void serialize(Archive& ar, const unsigned int version) 60 { 61 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( CMethod ); 62 ar & BOOST_SERIALIZATION_NVP( isAbstract ); 63 ar & BOOST_SERIALIZATION_NVP( isVirtual ); 64 ar & BOOST_SERIALIZATION_NVP( isConst ); 65 //ar & BOOST_SERIALIZATION_NVP( pInheritsClass ); 66 } 43 67 44 68 public: … … 91 115 class StaticMethod : public CMethod 92 116 { 117 // XMLシリアライズ用 118 private: 119 friend class boost::serialization::access; 120 template<class Archive> void serialize(Archive& ar, const unsigned int version) 121 { 122 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( CMethod ); 123 } 124 93 125 public: 94 126 StaticMethod( UserProc *pUserProc, Prototype::Accessibility accessibility ) … … 113 145 class Methods : public vector<CMethod *> 114 146 { 147 // XMLシリアライズ用 148 // TODO: xml実装 149 private: 150 friend class boost::serialization::access; 151 template<class Archive> void serialize(Archive& ar, const unsigned int version) 152 { 153 ar & boost::serialization::make_nvp("vector_CMethod", boost::serialization::base_object<vector<CMethod *>>(*this)); 154 } 155 115 156 public: 116 157 Methods(); -
trunk/jenga/include/smoothie/Parameter.h
r181 r203 15 15 16 16 const std::string initValue; 17 18 // XMLシリアライズ用 19 private: 20 friend class boost::serialization::access; 21 template<class Archive> void serialize(Archive& ar, const unsigned int version) 22 { 23 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Type ); 24 ar & BOOST_SERIALIZATION_NVP( varName ); 25 ar & BOOST_SERIALIZATION_NVP( isRef ); 26 ar & BOOST_SERIALIZATION_NVP( isArray ); 27 ar & BOOST_SERIALIZATION_NVP( subScripts ); 28 ar & BOOST_SERIALIZATION_NVP( initValue ); 29 } 17 30 18 31 public: … … 93 106 class Parameters : public std::vector<Parameter *> 94 107 { 108 // XMLシリアライズ用 109 private: 110 friend class boost::serialization::access; 111 template<class Archive> void serialize(Archive& ar, const unsigned int version) 112 { 113 ar & boost::serialization::make_nvp("vector_Parameter", boost::serialization::base_object<vector<Parameter *>>(*this)); 114 } 115 95 116 public: 96 117 -
trunk/jenga/include/smoothie/Procedure.h
r192 r203 16 16 17 17 private: 18 conststring name; // プロシージャ名18 string name; // プロシージャ名 19 19 20 20 Kind kind; … … 33 33 // ソースコードの位置 34 34 int codePos; 35 36 // XMLシリアライズ用 37 private: 38 friend class boost::serialization::access; 39 template<class Archive> void serialize(Archive& ar, const unsigned int version) 40 { 41 ar & BOOST_SERIALIZATION_NVP( name ); 42 ar & BOOST_SERIALIZATION_NVP( kind ); 43 ar & BOOST_SERIALIZATION_NVP( isCdecl ); 44 ar & BOOST_SERIALIZATION_NVP( isUsing ); 45 ar & BOOST_SERIALIZATION_NVP( params ); 46 ar & BOOST_SERIALIZATION_NVP( returnType ); 47 ar & BOOST_SERIALIZATION_NVP( codePos ); 48 } 35 49 36 50 public: … … 112 126 bool isCompiled; 113 127 114 public: 115 116 void Serialize( bool isRead ) 117 { 118 119 } 128 // XMLシリアライズ用 129 // TODO: xml実装(publicなクラスが残っている) 130 private: 131 friend class boost::serialization::access; 132 template<class Archive> void serialize(Archive& ar, const unsigned int version) 133 { 134 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure ); 135 ar & BOOST_SERIALIZATION_NVP( _paramStr ); 136 ar & BOOST_SERIALIZATION_NVP( secondParmNum ); 137 ar & BOOST_SERIALIZATION_NVP( realParams ); 138 ar & BOOST_SERIALIZATION_NVP( realSecondParmNum ); 139 ar & BOOST_SERIALIZATION_NVP( pParentClass ); 140 ar & BOOST_SERIALIZATION_NVP( pMethod ); 141 ar & BOOST_SERIALIZATION_NVP( isExport ); 142 ar & BOOST_SERIALIZATION_NVP( isSystem ); 143 ar & BOOST_SERIALIZATION_NVP( isAutoGeneration ); 144 ar & BOOST_SERIALIZATION_NVP( isCompiled ); 145 } 146 147 public: 120 148 121 149 UserProc( const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ): … … 260 288 class DllProc : public Procedure 261 289 { 262 constNamespaceScopes namespaceScopes;263 264 conststring dllFileName;265 conststring alias;290 NamespaceScopes namespaceScopes; 291 292 string dllFileName; 293 string alias; 266 294 int lookupAddress; 295 296 // XMLシリアライズ用 297 private: 298 friend class boost::serialization::access; 299 template<class Archive> void serialize(Archive& ar, const unsigned int version) 300 { 301 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure ); 302 ar & BOOST_SERIALIZATION_NVP( namespaceScopes ); 303 ar & BOOST_SERIALIZATION_NVP( dllFileName ); 304 ar & BOOST_SERIALIZATION_NVP( alias ); 305 ar & BOOST_SERIALIZATION_NVP( lookupAddress ); 306 } 267 307 268 308 public: … … 312 352 class ProcPointer : public Procedure 313 353 { 354 // XMLシリアライズ用 355 private: 356 friend class boost::serialization::access; 357 template<class Archive> void serialize(Archive& ar, const unsigned int version) 358 { 359 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure ); 360 } 361 314 362 public: 315 363 ProcPointer( Kind kind ): … … 323 371 class ProcPointers : public vector<ProcPointer *> 324 372 { 373 // XMLシリアライズ用 374 private: 375 friend class boost::serialization::access; 376 template<class Archive> void serialize(Archive& ar, const unsigned int version) 377 { 378 ar & boost::serialization::make_nvp("vector_ProcPointer", boost::serialization::base_object<vector<ProcPointer *>>(*this)); 379 } 380 325 381 public: 326 382 ProcPointers() -
trunk/jenga/include/smoothie/Prototype.h
r200 r203 79 79 { 80 80 Prototype::Accessibility accessibility; 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 ar & BOOST_SERIALIZATION_NVP( accessibility ); 88 } 89 81 90 public: 82 91 MemberPrototype( Prototype::Accessibility accessibility ) -
trunk/jenga/include/smoothie/Variable.h
r192 r203 6 6 class Variable : public Type 7 7 { 8 constNamespaceScopes namespaceScopes;8 NamespaceScopes namespaceScopes; 9 9 string name; 10 10 bool isConst; … … 14 14 15 15 bool isParameter; 16 17 // XMLシリアライズ用 18 // TODO: xml実装(publicなクラスが残っている) 19 private: 20 friend class boost::serialization::access; 21 template<class Archive> void serialize(Archive& ar, const unsigned int version) 22 { 23 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Type ); 24 ar & BOOST_SERIALIZATION_NVP( namespaceScopes ); 25 ar & BOOST_SERIALIZATION_NVP( name ); 26 ar & BOOST_SERIALIZATION_NVP( isConst ); 27 ar & BOOST_SERIALIZATION_NVP( isRef ); 28 ar & BOOST_SERIALIZATION_NVP( isArray ); 29 ar & BOOST_SERIALIZATION_NVP( subScripts ); 30 ar & BOOST_SERIALIZATION_NVP( isParameter ); 31 } 16 32 17 33 public: -
trunk/jenga/src/smoothie/Class.cpp
r192 r203 6 6 7 7 8 CClass::CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name )9 : isReady( false )10 , Prototype( namespaceScopes, name )11 , importedNamespaces( importedNamespaces )12 , ConstructorMemberSubIndex( -1 )13 , DestructorMemberSubIndex( -1 )14 , classType( Class )15 , pobj_InheritsClass( NULL )16 , vtblNum( 0 )17 , iAlign( 0 )18 , vtbl_offset( -1 )19 , isCompilingConstructor( false )20 , isCompilingDestructor( false )21 , pobj_NextClass( NULL )22 {23 }24 8 CClass::~CClass(){ 25 9 // 動的メンバ … … 284 268 bool CClass::IsSubClass( const CClass *pClass ) const 285 269 { 286 pClass = pClass->pobj_InheritsClass; 287 while( pClass ){ 288 if( this == pClass ) return true; 289 pClass = pClass->pobj_InheritsClass; 270 if( !pClass->HasSuperClass() ) 271 { 272 return false; 273 } 274 275 const CClass *pTempClass = &pClass->GetSuperClass(); 276 while( pTempClass ){ 277 if( this == pTempClass ) return true; 278 pTempClass = &pTempClass->GetSuperClass(); 290 279 } 291 280 return false;
Note:
See TracChangeset
for help on using the changeset viewer.