1 | #pragma once
|
---|
2 |
|
---|
3 | #include <vector>
|
---|
4 | #include <string>
|
---|
5 |
|
---|
6 | #include <Type.h>
|
---|
7 |
|
---|
8 | using namespace std;
|
---|
9 |
|
---|
10 | class TypeDefCollection;
|
---|
11 |
|
---|
12 | class TypeDef : public Symbol
|
---|
13 | {
|
---|
14 | friend TypeDefCollection;
|
---|
15 |
|
---|
16 | string baseName;
|
---|
17 | Type baseType;
|
---|
18 |
|
---|
19 | // XMLシリアライズ用
|
---|
20 | private:
|
---|
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 |
|
---|
31 | public:
|
---|
32 | TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
|
---|
33 | TypeDef()
|
---|
34 | {
|
---|
35 | }
|
---|
36 | ~TypeDef()
|
---|
37 | {
|
---|
38 | }
|
---|
39 |
|
---|
40 | const string &GetBaseName() const
|
---|
41 | {
|
---|
42 | return baseName;
|
---|
43 | }
|
---|
44 | const Type &GetBaseType() const
|
---|
45 | {
|
---|
46 | return baseType;
|
---|
47 | }
|
---|
48 | };
|
---|
49 |
|
---|
50 | class TypeDefCollection : public std::vector<TypeDef>
|
---|
51 | {
|
---|
52 | // XMLシリアライズ用
|
---|
53 | private:
|
---|
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 |
|
---|
63 | public:
|
---|
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 |
|
---|
71 | private:
|
---|
72 | void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
|
---|
73 | public:
|
---|
74 | void CollectTypeDefs();
|
---|
75 | };
|
---|