[182] | 1 | #pragma once
|
---|
[4] | 2 |
|
---|
[637] | 3 | class CConst
|
---|
| 4 | : public RelationalObjectModuleItem
|
---|
| 5 | , public Jenga::Common::ObjectInHashmap<CConst>
|
---|
[206] | 6 | {
|
---|
| 7 | Type type;
|
---|
| 8 | _int64 i64data;
|
---|
| 9 |
|
---|
[647] | 10 | // XML繧キ繝ェ繧「繝ゥ繧、繧コ逕ィ
|
---|
[206] | 11 | private:
|
---|
| 12 | friend class boost::serialization::access;
|
---|
| 13 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 14 | {
|
---|
| 15 | trace_for_serialize( "serializing - CConst" );
|
---|
| 16 |
|
---|
[637] | 17 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
|
---|
| 18 |
|
---|
| 19 | if( ActiveBasic::Common::Environment::IsRemoveExternal() )
|
---|
| 20 | {
|
---|
| 21 | if( this->IsExternal() )
|
---|
| 22 | {
|
---|
| 23 | this->NeedResolve();
|
---|
| 24 | return;
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 |
|
---|
[206] | 28 | ar & BOOST_SERIALIZATION_NVP( type );
|
---|
| 29 | ar & BOOST_SERIALIZATION_NVP( i64data );
|
---|
| 30 | }
|
---|
| 31 |
|
---|
[4] | 32 | public:
|
---|
[637] | 33 | CConst( const Symbol &symbol, const Type &newType, _int64 i64data)
|
---|
| 34 | : RelationalObjectModuleItem( symbol )
|
---|
[206] | 35 | , type( newType )
|
---|
| 36 | , i64data( i64data )
|
---|
[103] | 37 | {
|
---|
| 38 | }
|
---|
[637] | 39 | CConst( const Symbol &symbol, int value)
|
---|
| 40 | : RelationalObjectModuleItem( symbol )
|
---|
[206] | 41 | , type( Type(DEF_LONG) )
|
---|
| 42 | , i64data( value )
|
---|
[103] | 43 | {
|
---|
| 44 | }
|
---|
[206] | 45 | CConst()
|
---|
| 46 | {
|
---|
| 47 | }
|
---|
| 48 | ~CConst()
|
---|
| 49 | {
|
---|
| 50 | }
|
---|
[7] | 51 |
|
---|
[206] | 52 | virtual const std::string &GetKeyName() const
|
---|
[103] | 53 | {
|
---|
[206] | 54 | return GetName();
|
---|
[103] | 55 | }
|
---|
| 56 |
|
---|
[206] | 57 | Type GetType()
|
---|
| 58 | {
|
---|
| 59 | return type;
|
---|
| 60 | }
|
---|
| 61 | _int64 GetWholeData()
|
---|
| 62 | {
|
---|
| 63 | return i64data;
|
---|
| 64 | }
|
---|
| 65 | double GetDoubleData();
|
---|
[637] | 66 |
|
---|
[640] | 67 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[4] | 68 | };
|
---|
[206] | 69 | class Consts : public Jenga::Common::Hashmap<CConst>
|
---|
| 70 | {
|
---|
[647] | 71 | // XML繧キ繝ェ繧「繝ゥ繧、繧コ逕ィ
|
---|
[206] | 72 | private:
|
---|
| 73 | friend class boost::serialization::access;
|
---|
| 74 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 75 | {
|
---|
| 76 | trace_for_serialize( "serializing - Consts" );
|
---|
[4] | 77 |
|
---|
[206] | 78 | ar & boost::serialization::make_nvp("Hashmap_CConst",
|
---|
| 79 | boost::serialization::base_object<Jenga::Common::Hashmap<CConst>>(*this));
|
---|
| 80 | }
|
---|
[7] | 81 |
|
---|
[4] | 82 | public:
|
---|
| 83 |
|
---|
[637] | 84 | void Add( const Symbol &symbol, _int64 i64data, const Type &type );
|
---|
| 85 | void Add( const Symbol &symbol, int value);
|
---|
[7] | 86 |
|
---|
[206] | 87 | private:
|
---|
[579] | 88 | CConst *GetObjectPtr( const Symbol &symbol );
|
---|
[4] | 89 | public:
|
---|
| 90 |
|
---|
[579] | 91 | int GetBasicType( const Symbol &symbol );
|
---|
| 92 | _int64 GetWholeData( const Symbol &symbol );
|
---|
| 93 | double GetDoubleData( const Symbol &symbol );
|
---|
[600] | 94 | bool IsStringPtr( const Symbol &symbol, bool isUnicode );
|
---|
[4] | 95 | };
|
---|
| 96 |
|
---|
[637] | 97 | class ConstMacro
|
---|
| 98 | : public RelationalObjectModuleItem
|
---|
| 99 | , public Jenga::Common::ObjectInHashmap<ConstMacro>
|
---|
[206] | 100 | {
|
---|
| 101 | std::vector<std::string> parameters;
|
---|
| 102 | std::string expression;
|
---|
[4] | 103 |
|
---|
[647] | 104 | // XML繧キ繝ェ繧「繝ゥ繧、繧コ逕ィ
|
---|
[206] | 105 | private:
|
---|
| 106 | friend class boost::serialization::access;
|
---|
| 107 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 108 | {
|
---|
| 109 | trace_for_serialize( "serializing - ConstMacro" );
|
---|
[4] | 110 |
|
---|
[637] | 111 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
|
---|
| 112 |
|
---|
| 113 | if( ActiveBasic::Common::Environment::IsRemoveExternal() )
|
---|
| 114 | {
|
---|
| 115 | if( this->IsExternal() )
|
---|
| 116 | {
|
---|
| 117 | this->NeedResolve();
|
---|
| 118 | return;
|
---|
| 119 | }
|
---|
| 120 | }
|
---|
| 121 |
|
---|
[206] | 122 | ar & BOOST_SERIALIZATION_NVP( parameters );
|
---|
| 123 | ar & BOOST_SERIALIZATION_NVP( expression );
|
---|
| 124 | }
|
---|
[4] | 125 |
|
---|
[7] | 126 | public:
|
---|
[637] | 127 | ConstMacro( const Symbol &symbol, const std::vector<std::string> ¶meters, const std::string &expression )
|
---|
| 128 | : RelationalObjectModuleItem( symbol )
|
---|
[206] | 129 | , parameters( parameters )
|
---|
| 130 | , expression( expression )
|
---|
| 131 | {
|
---|
| 132 | }
|
---|
| 133 | ConstMacro()
|
---|
| 134 | {
|
---|
| 135 | }
|
---|
| 136 | ~ConstMacro()
|
---|
| 137 | {
|
---|
| 138 | }
|
---|
[7] | 139 |
|
---|
[206] | 140 | virtual const std::string &GetKeyName() const
|
---|
| 141 | {
|
---|
| 142 | return GetName();
|
---|
| 143 | }
|
---|
[7] | 144 |
|
---|
[206] | 145 | const std::vector<std::string> &GetParameters() const
|
---|
| 146 | {
|
---|
| 147 | return parameters;
|
---|
| 148 | }
|
---|
| 149 | const std::string &GetExpression() const
|
---|
| 150 | {
|
---|
| 151 | return expression;
|
---|
| 152 | }
|
---|
[637] | 153 |
|
---|
[640] | 154 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[206] | 155 | };
|
---|
[637] | 156 | class ConstMacros
|
---|
| 157 | : public Jenga::Common::Hashmap<ConstMacro>
|
---|
[206] | 158 | {
|
---|
[647] | 159 | // XML繧キ繝ェ繧「繝ゥ繧、繧コ逕ィ
|
---|
[7] | 160 | private:
|
---|
[206] | 161 | friend class boost::serialization::access;
|
---|
| 162 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 163 | {
|
---|
| 164 | trace_for_serialize( "serializing - ConstMacros" );
|
---|
[7] | 165 |
|
---|
[206] | 166 | ar & boost::serialization::make_nvp("Hashmap_ConstMacro",
|
---|
| 167 | boost::serialization::base_object<Jenga::Common::Hashmap<ConstMacro>>(*this));
|
---|
| 168 | }
|
---|
[7] | 169 |
|
---|
[206] | 170 | public:
|
---|
[637] | 171 | bool Add( const Symbol &symbol, const char *parameterStr );
|
---|
[579] | 172 | ConstMacro *Find( const Symbol &name );
|
---|
[4] | 173 | };
|
---|