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
CODProperty(int nId = OD_UNDEFINED)
Constructor.
CODProperty(const CODProperty& prop)
Copy constructor.
virtual ~CODProperty()
Destructor.
int m_nId
Integer code representing the property identifier.
ULONG m_ulRefCount
Reference count value.
int GetId() const
Returns the property identifier code.
void SetId(const int nId)
Sets the property identifier code.
virtual BOOL CompareId(const int nId) const
Compare the property identifier with another identifier.
ULONG STDMETHODCALLTYPE AddRef()
Add a reference to this object.
ULONG STDMETHODCALLTYPE Release()
Release a reference to this object.
ULONG GetRefCount() const
Returns the property object reference count.
virtual CODProperty* Dup()
Creates and returns a duplicate property object.
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.
virtual BOOL IsEqual(CODProperty* pProp)
Returns non-zero if the passed property object has the same identifier.
virtual void GetAsString(CString& strValue) const
Get the value of this property as a string.
virtual void SetAsString(const LPCTSTR lpszValue)
Set the value of this property as a string.
virtual void GetValue(CString& strValue) const
Get the value of this property as a string.
virtual void GetValue(int& nValue) const
Get the value of this property as a signed integer.
virtual void GetValue(UINT& nValue) const
Get the value of this property as an unsigned integer.
virtual void GetValue(DWORD& dwValue) const
Get the value of this property as a DWORD.
virtual void GetValue(float& fValue) const
Get the value of this property as a float.
virtual void GetValue(VARIANT& value) const
Get the value of this property as a VARIANT.
virtual void SetValue(const LPCTSTR lpszValue)
Set the value of this property as a string.
virtual void SetValue(const int nValue)
Set the value of this property as a signed integer.
virtual void SetValue(const UINT nValue)
Set the value of this property as an unsigned integer.
virtual void SetValue(const DWORD dwValue)
Set the value of this property as a DWORD.
virtual void SetValue(const float fValue)
Set the value of this property as a float.
virtual void SetValue(const VARIANT& value)
Set the value of this property as a VARIANT.
virtual void Serialize(CArchive& ar)
Serializes the property.