24#ifndef _ODSAVESTATE_INCLUDED_
25#define _ODSAVESTATE_INCLUDED_
83 operator const T&()
const
90#define OdSaveStateFlagDef(type, flag, name, flags) \
91 const type _##name##Flag = flag; \
92 OdSaveStateFlagImpl<type, _##name##Flag> name(flags)
93#define OdSaveStateFlag(type, flag, name, flags, newVal) \
94 const type _##name##Flag = flag; \
95 OdSaveStateFlagImpl<type, _##name##Flag> name(flags, newVal)
97#define OdSaveStateFlagDef(type, flag, name, flags) \
98 OdSaveStateFlagImpl<type, flag> name(flags)
99#define OdSaveStateFlag(type, flag, name, flags, newVal) \
100 OdSaveStateFlagImpl<type, flag> name(flags, newVal)
108template <
class T, T flag>
123 m_oldValue =
GETBIT(m_val, flag);
135 m_oldValue =
GETBIT(m_val, flag);
136 SETBIT(m_val, flag, bNewValue);
145 SETBIT(m_val, flag, m_oldValue);
151 operator bool()
const
166template <
class T, T flagsMask>
169 T &m_val, m_oldValue;
178 : m_val(variable), m_oldValue(variable & flagsMask)
189 : m_val(variable), m_oldValue(variable & flagsMask)
190 { variable = (variable & ~flagsMask) | newValue; }
198 m_val = (m_val & ~flagsMask) | m_oldValue;
204 operator const T&()
const
215template <
typename ObjType,
typename ValType>
223 void(ObjType::*setFunc)(ValType))
233 void(ObjType::*setFunc)(ValType), ValType newValue)
#define SETBIT(flags, bit, value)
#define GETBIT(flags, bit)
OdSaveStateFlagImpl(T &variable, bool bNewValue)
OdSaveStateFlagImpl(T &variable)
OdSaveStateFlagsMask(T &variable, const T &newValue)
OdSaveStateFlagsMask(T &variable)
OdSaveStateFunc(ObjType *pObj, ValType(ObjType::*getFunc)() const, void(ObjType::*setFunc)(ValType))
OdSaveStateFunc(ObjType *pObj, ValType(ObjType::*getFunc)() const, void(ObjType::*setFunc)(ValType), ValType newValue)
void(ObjType::* m_setFunc)(ValType)
ValType(ObjType::* m_getFunc)() const
OdSaveState(T &variable, const T &newValue)
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)