Public Member Functions | |
CField () | |
Constructor. | |
CField (const CField &field) | |
Copy constructor. | |
CField (FID fid, const TCHAR *name, EnType fieldType, CFormat *format) | |
Constructor. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetMfcString getMethod, CDataObject::pfnSetMfcString setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the STL string-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetStlString getMethod, CDataObject::pfnSetStlString setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the STL string-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetChar getMethod, CDataObject::pfnSetChar setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the char-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetUChar getMethod, CDataObject::pfnSetUChar setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the unsigned char-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetShort getMethod, CDataObject::pfnSetShort setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the short-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetUShort getMethod, CDataObject::pfnSetUShort setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the unsigned short-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetLong getMethod, CDataObject::pfnSetLong setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the long-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetULong getMethod, CDataObject::pfnSetULong setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the unsigned short-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetInt64 getMethod, CDataObject::pfnSetInt64 setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the int64-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetBool getMethod, CDataObject::pfnSetBool setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the bool-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetFloat getMethod, CDataObject::pfnSetFloat setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the float-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetDouble getMethod, CDataObject::pfnSetDouble setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the double-type field. | |
CField (FID fid, const TCHAR *name, CDataObject::pfnGetObjectPtr getMethod, CDataObject::pfnSetObjectPtr setMethod, CFormat *format, const TCHAR *getMethodName=0, const TCHAR *setMethodName=0) | |
Constructor for the pointer to CDataObject - type field. | |
virtual | ~CField () |
Virtual destructor. | |
virtual CField * | Clone () const |
FID | GetFid () const |
Gets a field identifier. | |
TString | GetName () const |
Gets a field name. | |
EnType | GetType () const |
Gets a field type. | |
CFormat * | GetFormat () const |
Gets a textual format. | |
TString | GetPfnGetName () const |
Gets the name of Get-methos. | |
TString | GetPfnSetName () const |
Gets the name of Set-methos. | |
bool | HasGetMethod () const |
Returns the value, indicating whether the field contains Get-method. | |
bool | HasSetMethod () const |
Returns the value, indicating whether the field contains Set-method. | |
CDataObject::pfnGetMfcString | PfnGetMfcString () const |
Returns MFC string-type Get-method. | |
CDataObject::pfnGetStlString | PfnGetStlString () const |
Returns STL string-type Get-method. | |
CDataObject::pfnGetChar | PfnGetChar () const |
Returns char-type Get-method. | |
CDataObject::pfnGetUChar | PfnGetUChar () const |
Returns unsigned char-type Get-method. | |
CDataObject::pfnGetShort | PfnGetShort () const |
Returns short-type Get-method. | |
CDataObject::pfnGetUShort | PfnGetUShort () const |
Returns unsigned short-type Get-method. | |
CDataObject::pfnGetLong | PfnGetLong () const |
Returns long-type Get-method. | |
CDataObject::pfnGetULong | PfnGetULong () const |
Returns unsigned long-type Get-method. | |
CDataObject::pfnGetInt64 | PfnGetInt64 () const |
Returns __int64 type Get-method. | |
CDataObject::pfnGetBool | PfnGetBool () const |
Returns bool-type Get-method. | |
CDataObject::pfnGetFloat | PfnGetFloat () const |
Returns float-type Get-method. | |
CDataObject::pfnGetDouble | PfnGetDouble () const |
Returns double-type Get-method. | |
CDataObject::pfnGetObjectPtr | PfnGetObjectPtr () const |
Returns pointer to CDataObject type Get-method. | |
CDataObject::pfnSetMfcString | PfnSetMfcString () const |
Returns MFC string-type Set-method. | |
CDataObject::pfnSetStlString | PfnSetStlString () const |
Returns STL string-type Set-method. | |
CDataObject::pfnSetChar | PfnSetChar () const |
Returns char-type Set-method. | |
CDataObject::pfnSetUChar | PfnSetUChar () const |
Returns unsigned char-type Set-method. | |
CDataObject::pfnSetShort | PfnSetShort () const |
Returns short-type Set-method. | |
CDataObject::pfnSetUShort | PfnSetUShort () const |
Returns unsigned short-type Set-method. | |
CDataObject::pfnSetLong | PfnSetLong () const |
Returns long-type Set-method. | |
CDataObject::pfnSetULong | PfnSetULong () const |
Returns unsigned long-type Set-method. | |
CDataObject::pfnSetInt64 | PfnSetInt64 () const |
Returns __int64 type Set-method. | |
CDataObject::pfnSetBool | PfnSetBool () const |
Returns boolean-type Set-method. | |
CDataObject::pfnSetFloat | PfnSetFloat () const |
Returns float-type Set-method. | |
CDataObject::pfnSetDouble | PfnSetDouble () const |
Returns double-type Set-method. | |
CDataObject::pfnSetObjectPtr | PfnSetObjectPtr () const |
Returns pointer to CDataObject type Set-method. |
C++ doesn't provide language possibilities to describe properties like Visual Basic. This class is equivalent to a property in Visual Basic and includes:
1. Integer identifier that can't be equal to Common::allFields(-1) or Common::fieldNotSpecified(-2).
2. Field name
3. Pointer to Get- method of the class derived from CDataObject
4. Pointer to Set- method of the class derived from CDataObject
5. Pointer to CFormat object which converts the value returned by Get-method to a formatted string and vice versa.
The field can be either single-sided or double-sided, i.e. it can have either Get or Set methods separately or combined. Each field has its type that depends on the type of Set and Get methods. The field is also used by CDataObject to call the methods of the derived classes by its identifiers.
DF_BEGIN_FIELD_MAP(COrder) ... DF_DOUBLE_ID(FidUnitPrice, "UnitPrice", &COrder::GetUnitPrice, 0, new CDoubleFormat(3, false, false, _T('$'))) ... DF_END_FIELD_MAP()
Nevertheless, if you want to handle the format yourself, you can clone it:
class CMyFormatCollection { static Dapfor::Common::CFormat& GetSomeFormat(); ... }; //In the static declaration you can use something like this: DF_DOUBLE_ID(FidUnitPrice, "UnitPrice", &COrder::GetUnitPrice, 0, CMyFormatCollection::GetSomeFormat().Clone())
CField | ( | ) |
Copy constructor.
[in] | field | Field to be copied. If there is a format, it will be cloned. |
Constructor.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | fieldType | Field type |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetMfcString | getMethod, | |||
CDataObject::pfnSetMfcString | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the STL string-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetStlString | getMethod, | |||
CDataObject::pfnSetStlString | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the STL string-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetChar | getMethod, | |||
CDataObject::pfnSetChar | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the char-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetUChar | getMethod, | |||
CDataObject::pfnSetUChar | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the unsigned char-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetShort | getMethod, | |||
CDataObject::pfnSetShort | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the short-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetUShort | getMethod, | |||
CDataObject::pfnSetUShort | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the unsigned short-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetLong | getMethod, | |||
CDataObject::pfnSetLong | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the long-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetULong | getMethod, | |||
CDataObject::pfnSetULong | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the unsigned short-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetInt64 | getMethod, | |||
CDataObject::pfnSetInt64 | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the int64-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetBool | getMethod, | |||
CDataObject::pfnSetBool | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the bool-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetFloat | getMethod, | |||
CDataObject::pfnSetFloat | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the float-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetDouble | getMethod, | |||
CDataObject::pfnSetDouble | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the double-type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
CField | ( | FID | fid, | |
const TCHAR * | name, | |||
CDataObject::pfnGetObjectPtr | getMethod, | |||
CDataObject::pfnSetObjectPtr | setMethod, | |||
CFormat * | format, | |||
const TCHAR * | getMethodName = 0 , |
|||
const TCHAR * | setMethodName = 0 | |||
) |
Constructor for the pointer to CDataObject - type field.
[in] | fid | Field identifier |
[in] | name | Field name |
[in] | getMethod | Pointer to Get-method in CDataObject. It may be zero. |
[in] | setMethod | Pointer to Set-method in CDataObject. It may be zero. |
[in] | format | Textual format to convert unformatted value to a string and vice versa. If this parameter is not zero, then the destructor of this class will destroy it. |
[in] | getMethodName | Name of Get-method. |
[in] | setMethodName | Name of Set-method. |
~CField | ( | ) | [virtual] |
Virtual destructor.
Frees all resources. Destroys the textual format if it exists.
CField * Clone | ( | ) | const [virtual] |
TString GetName | ( | ) | const |
Gets a field name.
TString GetPfnGetName | ( | ) | const |
TString GetPfnSetName | ( | ) | const |
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |