1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D -->
3 // File: ModelHighAPI_FeatureStore.h
4 // Created: 12 August 2016
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelHighAPI_FeatureStore_H_
8 #define ModelHighAPI_FeatureStore_H_
10 #include "ModelHighAPI.h"
16 class ModelAPI_Feature;
19 class ModelAPI_Attribute;
21 typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
22 typedef std::shared_ptr<ModelAPI_Attribute> AttributePtr;
24 /**\class ModelHighAPI_FeatureStore
26 * \brief Allows to compare the original and the dumped/executed feature
28 class ModelHighAPI_FeatureStore {
29 /// dumps of attributes of the stored feature (id -> dump)
30 std::map<std::string, std::string> myAttrs;
31 /// dumps of attributes of results (list of results id -> dumps)
32 std::list<std::map<std::string, std::string> > myRes;
34 // unused constructor for the map container needs
35 ModelHighAPI_FeatureStore() {}
36 // constructor that initializes this object by feature to store
37 ModelHighAPI_FeatureStore(FeaturePtr theFeature);
38 // compares the stored feature information with the given feature
39 std::string compare(FeaturePtr theFeature);
42 /// stores the information about all attributes of data in map
43 void storeData(std::shared_ptr<ModelAPI_Data> theData,
44 std::map<std::string, std::string>& theAttrs);
45 /// compares the information about all attributes of data with map
46 /// returns not empty string with error if something is different
47 std::string compareData(std::shared_ptr<ModelAPI_Data> theData,
48 std::map<std::string, std::string>& theAttrs);
49 /// dumps the attribute content to the string
50 std::string dumpAttr(const AttributePtr& theAttr);
51 /// dumps the shape main charatceristics to string
52 std::string dumpShape(std::shared_ptr<GeomAPI_Shape>& theShape);