source: dev/trunk/abdev/BasicCompiler_Common/include/TypeDef.h@ 206

Last change on this file since 206 was 206, checked in by dai_9181, 17 years ago

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

File size: 1.8 KB
Line 
1#pragma once
2
3#include <vector>
4#include <string>
5
6#include <jenga/include/smoothie/Namespace.h>
7
8#include <Type.h>
9#include <Symbol.h>
10
11using namespace std;
12
13class TypeDefCollection;
14
15class TypeDef : public Symbol
16{
17 friend TypeDefCollection;
18
19 string baseName;
20 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
34public:
35 TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
36 TypeDef()
37 {
38 }
39 ~TypeDef()
40 {
41 }
42
43 const string &GetBaseName() const
44 {
45 return baseName;
46 }
47 const Type &GetBaseType() const
48 {
49 return baseType;
50 }
51};
52
53class TypeDefCollection : public std::vector<TypeDef>
54{
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
66public:
67 TypeDefCollection();
68 ~TypeDefCollection();
69
70 void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
71 int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
72 int GetIndex( const string &fullName ) const;
73
74private:
75 void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
76public:
77 void Init();
78};
Note: See TracBrowser for help on using the repository browser.