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

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