source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/TypeDef.h@ 509

Last change on this file since 509 was 509, checked in by dai_9181, 16 years ago

Symbolクラスをab_commonプロジェクトに移動した。

File size: 1.7 KB
RevLine 
[193]1#pragma once
2
3#include <vector>
4#include <string>
5
[206]6#include <Type.h>
7
[193]8using namespace std;
9
10class TypeDefCollection;
11
[206]12class TypeDef : public Symbol
13{
[193]14 friend TypeDefCollection;
15
16 string baseName;
17 Type baseType;
[206]18
19 // XMLシリアライズ用
20private:
21 friend class boost::serialization::access;
22 template<class Archive> void serialize(Archive& ar, const unsigned int version)
23 {
24 trace_for_serialize( "serializing - TypeDef" );
25
26 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
27 ar & BOOST_SERIALIZATION_NVP( baseName );
28 ar & BOOST_SERIALIZATION_NVP( baseType );
29 }
30
[193]31public:
32 TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
[206]33 TypeDef()
[193]34 {
35 }
[206]36 ~TypeDef()
37 {
38 }
39
[193]40 const string &GetBaseName() const
41 {
42 return baseName;
43 }
44 const Type &GetBaseType() const
45 {
46 return baseType;
47 }
48};
49
[206]50class TypeDefCollection : public std::vector<TypeDef>
[193]51{
[206]52 // XMLシリアライズ用
53private:
54 friend class boost::serialization::access;
55 template<class Archive> void serialize(Archive& ar, const unsigned int version)
56 {
57 trace_for_serialize( "serializing - TypeDefCollection" );
58
59 ar & boost::serialization::make_nvp("vector_TypeDef",
60 boost::serialization::base_object<std::vector<TypeDef>>(*this));
61 }
62
[193]63public:
64 TypeDefCollection();
65 ~TypeDefCollection();
66
67 void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
68 int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
69 int GetIndex( const string &fullName ) const;
70
71private:
72 void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
73public:
[272]74 void CollectTypeDefs();
[193]75};
Note: See TracBrowser for help on using the repository browser.