Salome HOME
Revert insufficient changes to avoid compilation error on Linux
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Dump.h
1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D
2
3 // File:    ExchangePlugin_Dump.h
4 // Created: August 1, 2016
5 // Author:  Artem ZHIDKOV
6
7 #ifndef EXCHANGEPLUGIN_DUMP_H_
8 #define EXCHANGEPLUGIN_DUMP_H_
9
10 #include <ExchangePlugin.h>
11
12 #include <ModelAPI_Feature.h>
13
14 /**
15  * \class ExchangePlugin_Dump
16  * \ingroup Plugins
17  * \brief Store full model as a Python script
18  */
19 class ExchangePlugin_Dump : public ModelAPI_Feature
20 {
21 public:
22   /// Feature kind
23   inline static const std::string& ID()
24   {
25     static const std::string MY_DUMP_ID("Dump");
26     return MY_DUMP_ID;
27   }
28   /// attribute name of file path
29   inline static const std::string& FILE_PATH_ID()
30   {
31     static const std::string MY_FILE_PATH_ID("file_path");
32     return MY_FILE_PATH_ID;
33   }
34   /// attribute name of file format
35   inline static const std::string& FILE_FORMAT_ID()
36   {
37     static const std::string MY_FILE_FORMAT_ID("file_format");
38     return MY_FILE_FORMAT_ID;
39   }
40
41   /// Default constructor
42   EXCHANGEPLUGIN_EXPORT ExchangePlugin_Dump();
43   /// Default destructor
44   EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_Dump();
45
46   /// Returns the unique kind of a feature
47   EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind()
48   {
49     return ExchangePlugin_Dump::ID();
50   }
51
52   /// Request for initialization of data model of the feature: adding all attributes
53   EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
54
55   /// Computes or recomputes the results
56   EXCHANGEPLUGIN_EXPORT virtual void execute();
57
58   /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
59   EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
60
61   /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
62   EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
63
64 protected:
65   /// Performs dump to the file
66   EXCHANGEPLUGIN_EXPORT void dump(const std::string& theFileName);
67 };
68
69 #endif