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

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

ヘッダファイルを整理中

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