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