@@ -21,6 +21,7 @@ License
2121\*---------------------------------------------------------------------------*/
2222#pragma once
2323#include " HXDefine.h"
24+ #include < memory>
2425#include < string>
2526
2627
@@ -37,18 +38,12 @@ class NameValuePair
3738
3839class FieldNamePair
3940{
40- public:
41- FieldNamePair ();
42- ~FieldNamePair ();
4341public:
4442 static void SetField ( int solverType, NameValuePair & valuePair );
4543};
4644
4745class FieldAlloc
4846{
49- public:
50- FieldAlloc ();
51- ~FieldAlloc ();
5247public:
5348 static void AllocateAllFields ( int solverType, const std::string & basicString );
5449 static void InitField ( int solverType, const std::string & basicString );
@@ -65,17 +60,14 @@ class FieldAlloc
6560class ReadInterfaceVar
6661{
6762public:
68- ReadInterfaceVar ();
69- ~ReadInterfaceVar ();
70- public:
71- static void AddFieldName ( int solverType, int fieldType, StringField & nameList );
63+ static void AddFieldName (
64+ int solverType,
65+ int fieldType,
66+ StringField & nameList );
7267};
7368
7469class ParaNameDim
7570{
76- public:
77- ParaNameDim ();
78- ~ParaNameDim ();
7971public:
8072 StringField nameList;
8173 IntField dimList;
@@ -87,9 +79,9 @@ class ParaNameDimData
8779 ParaNameDimData ();
8880 ~ParaNameDimData ();
8981public:
90- ParaNameDim * comPara;
91- ParaNameDim * strPara;
92- ParaNameDim * unsPara;
82+ std::unique_ptr< ParaNameDim> comPara;
83+ std::unique_ptr< ParaNameDim> strPara;
84+ std::unique_ptr< ParaNameDim> unsPara;
9385public:
9486 ParaNameDim * GetParaNameDim ( const std::string & typeName );
9587};
@@ -100,7 +92,7 @@ class ReadSuperPara
10092 ReadSuperPara ();
10193 ~ReadSuperPara ();
10294public:
103- ParaNameDimData * paraNameDimData;
95+ std::unique_ptr< ParaNameDimData> paraNameDimData;
10496 int solverType;
10597public:
10698 void Register ( const std::string & fileName, int index );
@@ -114,6 +106,7 @@ class ReadSuperPara
114106
115107
116108class TextFileParser ;
109+
117110class BoolIO
118111{
119112public:
@@ -122,18 +115,20 @@ class BoolIO
122115public:
123116 StringField boolNameList;
124117 BoolField boolValueList;
125- int valueFlag;
126- TextFileParser * textFileParser;
127118 NameValuePair nameValuePair;
128- ParaNameDimData * paraNameDimData;
129119public:
130120 void Add ( const std::string & name, bool value );
131- void ReadBool ( TextFileParser * textFileParser );
132- void ReadSuperBool ( TextFileParser * textFileParser );
121+ void ReadBool ( TextFileParser & textFileParser );
122+ void ReadSuperBool ( TextFileParser & textFileParser );
133123 bool CalcVarValue ( const std::string & varName );
134- void Read ();
135- void ReadFile ( const std::string & fileName, int valueFlag = 0 );
136-
124+ void Read (
125+ TextFileParser & textFileParser,
126+ int valueFlag,
127+ ParaNameDimData * paraNameDimData = nullptr );
128+ void ReadFile (
129+ const std::string & fileName,
130+ int valueFlag = 0 ,
131+ ParaNameDimData * paraNameDimData = nullptr );
137132};
138133
139134bool CalcBoolExp ( bool var1, const std::string & opName, bool var2 );
0 commit comments