MeVisLab Toolbox Reference
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 {
29 public:
30
32 typedef enum {
33 AutoUpdateModeDoNothing = 0,
36 AutoUpdateModeCount
37 } AutoUpdateMode;
38
41
43 ~LoadBase() override;
44
46 bool loadObject();
47
50
61
62
64
65 protected:
66
69
72 void activateAttachments() override;
73
76
77 private:
78
80 void showError(const std::string &msg) const;
81
84
86 static const char* AutoUpdateModeNames[];
87
88 }; // class LoadBase
89
91
92#endif
Field to encapsulate a pointer to an ML base object.
Definition mlFields.h:797
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition mlBase.h:59
Field to encapsulate a boolean value.
Definition mlFields.h:58
Base class for all ML Engines which are derived from Module, which have no inputs or outputs and whic...
Definition mlEngine.h:30
Field to encapsulate an enumerated value.
Definition mlFields.h:195
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:52
NotifyField * _fldLoadButton
Load object.
Definition mlLoadBase.h:53
BoolField * _fldUpToDate
Indicates whether the current output corresponds to the filename.
Definition mlLoadBase.h:60
@ AutoUpdateModeAutoClear
Definition mlLoadBase.h:34
@ AutoUpdateModeAutoUpdate
Definition mlLoadBase.h:35
bool loadObject()
loads a new object
EnumField * _fldLoadMode
Specifies the file format for the object.
Definition mlLoadBase.h:59
LoadBase()
constructor:
StringField * _fldLoadDirName
Name of the directory the file is to be restored from.
Definition mlLoadBase.h:56
EnumField * _fldAutoUpdateMode
Auto-load mode. Use anything other than Auto-Clear with care.
Definition mlLoadBase.h:51
StringField * _fldNodeName
Name of the root node of the object when storing/restoring.
Definition mlLoadBase.h:54
StringField * _fldFileStatus
Field for status messages concerning file I/O.
Definition mlLoadBase.h:58
~LoadBase() override
destructor:
void deleteObject()
deletes the current object
Base * _outputObject
object behind _fldBaseOutput
Definition mlLoadBase.h:75
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:57
BaseField * _fldBaseOutput
Output connection.
Definition mlLoadBase.h:63
void handleNotification(Field *field) override
Handle field notifications.
StringField * _fldLoadFileName
Name of the file the object is to be restored from.
Definition mlLoadBase.h:55
Field without value for notifications.
Definition mlFields.h:659
Field to encapsulate a string value.
Definition mlFields.h:610
#define ML_MODULE_CLASS_HEADER(className)
Like 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.