[193] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | #include <vector>
|
---|
| 4 | #include <string>
|
---|
| 5 |
|
---|
[206] | 6 | #include <Type.h>
|
---|
| 7 |
|
---|
[193] | 8 | using namespace std;
|
---|
| 9 |
|
---|
| 10 | class TypeDefCollection;
|
---|
| 11 |
|
---|
[206] | 12 | class TypeDef : public Symbol
|
---|
| 13 | {
|
---|
[193] | 14 | friend TypeDefCollection;
|
---|
| 15 |
|
---|
| 16 | string baseName;
|
---|
| 17 | Type baseType;
|
---|
[206] | 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 |
|
---|
[193] | 31 | public:
|
---|
| 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] | 50 | class TypeDefCollection : public std::vector<TypeDef>
|
---|
[193] | 51 | {
|
---|
[206] | 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 |
|
---|
[193] | 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:
|
---|
[272] | 74 | void CollectTypeDefs();
|
---|
[193] | 75 | };
|
---|