MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlLoadBase.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_LOAD_BASE_H
14#define ML_LOAD_BASE_H
15
16
18
19#include "mlParserSystem.h"
20#include "mlEngine.h"
21#include "mlModuleIncludes.h"
22
24
28{
29public:
31 typedef enum {
32 AutoUpdateModeDoNothing = 0,
35 AutoUpdateModeCount
36 } AutoUpdateMode;
37
40
42 ~LoadBase() override;
43
45 bool loadObject();
46
49
60
61
63
64protected:
67
70 void activateAttachments() override;
71
74
75private:
77 void showError(const std::string& msg) const;
78
81
83 static const char* AutoUpdateModeNames[];
84
85}; // class LoadBase
86
88
89#endif
Field to encapsulate a pointer to an ML base object.
Definition mlFields.h:813
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition mlBase.h:63
Field to encapsulate a boolean value.
Definition mlFields.h:56
Base class for all ML Engines that are derived from Module, and have no inputs or outputs but impleme...
Definition mlEngine.h:30
Field to encapsulate an enumerated value.
Definition mlFields.h:185
Base class for all fields used in the ML.
Definition mlField.h:73
Allows to load ml::base-derived objects from file.
Definition mlLoadBase.h:28
NotifyField * _fldClearButton
Clear loaded object.
Definition mlLoadBase.h:51
NotifyField * _fldLoadButton
Load object.
Definition mlLoadBase.h:52
BoolField * _fldUpToDate
Indicates whether the current output corresponds to the filename.
Definition mlLoadBase.h:59
@ AutoUpdateModeAutoClear
Definition mlLoadBase.h:33
@ AutoUpdateModeAutoUpdate
Definition mlLoadBase.h:34
bool loadObject()
loads a new object
EnumField * _fldLoadMode
Specifies the file format for the object.
Definition mlLoadBase.h:58
LoadBase()
constructor:
StringField * _fldLoadDirName
Name of the directory the file is to be restored from.
Definition mlLoadBase.h:55
EnumField * _fldAutoUpdateMode
Auto-load mode. Use anything other than Auto-Clear with care.
Definition mlLoadBase.h:50
StringField * _fldNodeName
Name of the root node of the object when storing/restoring.
Definition mlLoadBase.h:53
StringField * _fldFileStatus
Field for status messages concerning file I/O.
Definition mlLoadBase.h:57
~LoadBase() override
destructor:
void deleteObject()
deletes the current object
Base * _outputObject
object behind _fldBaseOutput
Definition mlLoadBase.h:73
void activateAttachments() override
resets fldUpToDate, calls handleNotification once after the module is loaded on the network and all f...
BoolField * _fldUseLoadDir
Indicates whether the load dir field is used.
Definition mlLoadBase.h:56
BaseField * _fldBaseOutput
Output connection.
Definition mlLoadBase.h:62
void handleNotification(Field *field) override
Handle field notifications.
StringField * _fldLoadFileName
Name of the file the object is to be restored from.
Definition mlLoadBase.h:54
Field without value for notifications.
Definition mlFields.h:687
Field to encapsulate a string value.
Definition mlFields.h:634
#define ML_MODULE_CLASS_HEADER(className)
Similar to ML_CLASS_HEADER for the usage of derived classes from Module.
#define PARSER_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.