CODProperty Class

class CODProperty: public CObject, public IODObject

This is the base class for all property objects.

Properties consist of an integer identifier and one or more values. Properties provide a flexible way to extend the attributes of an object at run-time, without the need to add statically compiled data members. Because all properties are derived from this common base class, they can be treated uniformally through this interface. Derived property classes implement the versions of GetValue and SetValue that are applicable to the type of property. If a derived class does not implement a particular version of GetValue and SetValue, the base class implementation throws an exception.

Properties support reference counting through the IODObject interface.

Defined in: OdProperty.h

Class Members

VIEWS_API CODProperty(int nId = OD_UNDEFINED)

Constructor.

VIEWS_API CODProperty(const CODProperty& prop)

Copy constructor.

VIEWS_API virtual ~CODProperty()

Destructor.

int m_nId

Integer code representing the property identifier.

ULONG m_ulRefCount

Reference count value.

VIEWS_API int GetId() const

Returns the property identifier code.

VIEWS_API void SetId(const int nId)

Sets the property identifier code.

VIEWS_API virtual BOOL CompareId(const int nId) const

Compare the property identifier with another identifier.

VIEWS_API ULONG STDMETHODCALLTYPE AddRef()

Add a reference to this object.

VIEWS_API ULONG STDMETHODCALLTYPE Release()

Release a reference to this object.

VIEWS_API ULONG GetRefCount() const

Returns the property object reference count.

VIEWS_API virtual CODProperty* Dup()

Creates and returns a duplicate property object.

VIEWS_API virtual void Merge(CODProperty* pProperty, DWORD dwChangeFlags = OD_CHANGE_ALL)

Merges the properties in the passed object with the current using the provided change flags.

VIEWS_API virtual BOOL IsEqual(CODProperty* pProp)

Returns non-zero if the passed property object has the same identifier.

VIEWS_API virtual void GetAsString(CString& strValue) const

Get the value of this property as a string.

VIEWS_API virtual void SetAsString(const LPCTSTR lpszValue)

Set the value of this property as a string.

VIEWS_API virtual void GetValue(CString& strValue) const

Get the value of this property as a string.

VIEWS_API virtual void GetValue(int& nValue) const

Get the value of this property as a signed integer.

VIEWS_API virtual void GetValue(UINT& nValue) const

Get the value of this property as an unsigned integer.

VIEWS_API virtual void GetValue(DWORD& dwValue) const

Get the value of this property as a DWORD.

VIEWS_API virtual void GetValue(float& fValue) const

Get the value of this property as a float.

VIEWS_API virtual void GetValue(VARIANT& value) const

Get the value of this property as a VARIANT.

VIEWS_API virtual void SetValue(const LPCTSTR lpszValue)

Set the value of this property as a string.

VIEWS_API virtual void SetValue(const int nValue)

Set the value of this property as a signed integer.

VIEWS_API virtual void SetValue(const UINT nValue)

Set the value of this property as an unsigned integer.

VIEWS_API virtual void SetValue(const DWORD dwValue)

Set the value of this property as a DWORD.

VIEWS_API virtual void SetValue(const float fValue)

Set the value of this property as a float.

VIEWS_API virtual void SetValue(const VARIANT& value)

Set the value of this property as a VARIANT.

VIEWS_API virtual void Serialize(CArchive& ar)

Serializes the property.