ffead.server.doc
Reflection.h
1 /*
2  Copyright 2009-2012, Sumeet Chhetri
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 /*
17  * Reflection.h
18  *
19  * Created on: Aug 21, 2009
20  * Author: sumeet
21  */
22 
23 #ifndef REFLECTION_H_
24 #define REFLECTION_H_
25 #include "PropFileReader.h"
26 #include "Method.h"
27 #include "Field.h"
28 #include "CastUtil.h"
29 #include "AfcUtil.h"
30 #include "Logger.h"
31 #include "RegexUtil.h"
32 class Reflection {
33  strVec pub,pri,pro;
34  bool prosetser;
35  string classN,baseClassN,bcvisib;
36  bool generateClassInfoFromDD(string);
37  bool generateClassInfo(string);
38  void collectInfo(string,string);
39  strVec list(string);
40  map<string,bool> methsall;
41  static map<string,bool> invalidcls;
42  Logger logger;
43 public:
44  static bool isValidClass(string claz)
45  {
46  return invalidcls.find(claz)==invalidcls.end();
47  }
48  Reflection();
49  virtual ~Reflection();
50  string updateClassDefinition(string, bool);
51  string updateTemplateContextDefinition(string, bool);
52  strVec getAfcObjectData(string className,bool object,strVec& privf, bool &isOpForSet);
53  strVec getAfcObjectData(string,bool);
54  propMap getDbTableInfo(string);
55  string generateClassDefinitionsAll(strVec,string &);
56  string generateSerDefinitionAll(strVec all,string &includeRef, bool isBinary,string&,string&,string&,string&);
57  string generateClassDefinition(string,string &,string &,string &,string &,string &);
58  string generateSerDefinition(string,string &,string &,string &,string &);
59  string generateClassDefinitions(string,string &,string &,string &,string &,string &);
60  string generateSerDefinitions(string,string &,string &,string &,string &,bool,string&,string &,string&,string&);
61 
62  string generateSerDefinitionBinary(string className,string &includesDefs,string &typedefs,string &classes,string &methods);
63 };
64 
65 #endif /* REFLECTION_H_ */