00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CONFIGVARIABLEBASE_H
00016 #define CONFIGVARIABLEBASE_H
00017
00018 #include "dtoolbase.h"
00019 #include "configFlags.h"
00020 #include "configVariableCore.h"
00021 #include "configDeclaration.h"
00022 #include "configVariableManager.h"
00023 #include "vector_string.h"
00024 #include "pset.h"
00025
00026
00027
00028
00029
00030 #ifdef PRC_SAVE_DESCRIPTIONS
00031 #define PRC_DESC(description) description
00032 #else
00033 #define PRC_DESC(description) ""
00034 #endif
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 class EXPCL_DTOOLCONFIG ConfigVariableBase : public ConfigFlags {
00049 protected:
00050 INLINE ConfigVariableBase(const string &name, ValueType type);
00051 ConfigVariableBase(const string &name, ValueType type,
00052 const string &description, int flags);
00053 INLINE ~ConfigVariableBase();
00054
00055 PUBLISHED:
00056 INLINE const string &get_name() const;
00057
00058 INLINE ValueType get_value_type() const;
00059 INLINE const string &get_description() const;
00060 INLINE int get_flags() const;
00061 INLINE bool is_closed() const;
00062 INLINE int get_trust_level() const;
00063 INLINE bool is_dynamic() const;
00064
00065 INLINE bool clear_local_value();
00066 INLINE bool has_local_value() const;
00067 INLINE bool has_value() const;
00068
00069 INLINE void output(ostream &out) const;
00070 INLINE void write(ostream &out) const;
00071
00072 protected:
00073 void record_unconstructed() const;
00074 bool was_unconstructed() const;
00075
00076 ConfigVariableCore *_core;
00077
00078 typedef pset<const ConfigVariableBase *> Unconstructed;
00079 static Unconstructed *_unconstructed;
00080 };
00081
00082 INLINE ostream &operator << (ostream &out, const ConfigVariableBase &variable);
00083
00084 #include "configVariableBase.I"
00085
00086 #endif