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"
17 class ModelAPI_Feature;
20 class ModelAPI_Attribute;
22 typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
23 typedef std::shared_ptr<ModelAPI_Attribute> AttributePtr;
25 /**\class ModelHighAPI_FeatureStore
27 * \brief Allows to compare the original and the dumped/executed feature
29 class ModelHighAPI_FeatureStore {
30 /// dumps of attributes of the stored feature (id -> dump)
31 std::map<std::string, std::string> myAttrs;
32 /// dumps of attributes of results (list of results id -> dumps)
33 std::list<std::map<std::string, std::string> > myRes;
35 // unused constructor for the map container needs
36 ModelHighAPI_FeatureStore() {}
37 // constructor that initializes this object by feature to store
38 ModelHighAPI_FeatureStore(FeaturePtr theFeature);
39 // compares the stored feature information with the given feature
40 std::string compare(FeaturePtr theFeature);
43 /// stores the information about all attributes of data in map
44 void storeData(std::shared_ptr<ModelAPI_Data> theData,
45 std::map<std::string, std::string>& theAttrs);
46 /// compares the information about all attributes of data with map
47 /// returns not empty string with error if something is different
48 std::string compareData(std::shared_ptr<ModelAPI_Data> theData,
49 std::map<std::string, std::string>& theAttrs);
50 /// dumps the attribute content to the string
51 std::string dumpAttr(const AttributePtr& theAttr);
52 /// dumps the shape main charatceristics to string
53 std::string dumpShape(std::shared_ptr<GeomAPI_Shape>& theShape);