GetSet  .9
A c++ library for load/saving typed and named properties and automatic GUI.
GetSet.hxx File Reference
#include "GetSetDictionary.h"

Go to the source code of this file.

Classes

class  GetSet< BasicType >
 Syntactic Sugar to access and change GetSet parameters. More...
class  GetSetInternal::GetSetDataSlider
class  GetSetGui::Slider
class  GetSetInternal::GetSetDataEnum
class  GetSetGui::Enum
class  GetSetInternal::GetSetDataTrigger
class  GetSetGui::Trigger
class  GetSetInternal::GetSetDataStaticText
class  GetSetGui::StaticText
class  GetSetInternal::GetSetDataReadOnlyText
class  GetSetGui::ReadOnlyText
class  GetSetInternal::GetSetDataDirectory
class  GetSetGui::Directory
class  GetSetInternal::GetSetDataFile
class  GetSetGui::File

Namespaces

namespace  GetSetInternal
 A GetSet<double> with additional range information, so that it could be represented as a slider.
namespace  GetSetGui

Macros

#define GETSET_SPECIALIZATION(SPECIAL_TYPE, BASE_TYPE, CLASS_BODY)
 Specializations for GUI representations.
#define GETSET_TAG(TYPE, TAG)

Macro Definition Documentation

#define GETSET_SPECIALIZATION (   SPECIAL_TYPE,
  BASE_TYPE,
  CLASS_BODY 
)
Value:
namespace GetSetInternal { \
class GetSetData##SPECIAL_TYPE : public GetSetData<BASE_TYPE> { \
virtual std::string getType() const { return #SPECIAL_TYPE; } \
}; \
} \
namespace GetSetGui { \
class SPECIAL_TYPE : public GetSet<BASE_TYPE> { \
public: \
SPECIAL_TYPE(GetSetDictionary& d, const std::string& s, const std::string k) \
: GetSet<BASE_TYPE>(d) { section=s; key=k; forceType(); } \
SPECIAL_TYPE(const std::string& s, const std::string k) \
: GetSet<BASE_TYPE>(GetSetDictionary::globalDictionary()){ section=s; key=k; forceType(); } \
void operator=(const BASE_TYPE& v) { setString(toString(v)); } \
operator BASE_TYPE() const { return stringTo<BASE_TYPE>(getString()); } \
CLASS_BODY \
protected: \
void forceType() { \
GetSetInternal::GetSetDataInterface* p=dict.getDatainterface(section,key); \
if (p && ! dynamic_cast<GetSetInternal::GetSetData##SPECIAL_TYPE*>(p)) { delete p; p=0x0; } \
if (!p) { \
dict.get()[section][key]=new GetSetInternal::GetSetData##SPECIAL_TYPE(); \
dict.signalCreate(section,key); \
} \
} \
}; \
}

Specializations for GUI representations.

#define GETSET_TAG (   TYPE,
  TAG 
)
Value:
void set##TAG(const TYPE& value) { dict.get()[section][key]->attributes[#TAG]=toString(value); } \
TYPE get##TAG() const {return stringTo<TYPE>(dict.get()[section][key]->attributes[#TAG]);}