Public Types | |
typedef CFormat *(* | pfnCreate )() |
Function prototype to create a format object. | |
Static Public Member Functions | |
static bool | RegisterFormat (const TString &formatName, pfnCreate f) |
Registers a new format. | |
static CFormat * | Create (const TString &formatName) |
Creates a new format object by a string. |
The factory enables creating CFormat object by a string. The factory was designed for serialization purpose, however it can be used in another way. To make format registration easier, DF_DECLARE_FORMAT() macro can be used. If there are two formats with the same name, but in different namespaces, an ambiguous situation may occur during the registration. To avoid this, it is recommended to use a full name together with a namespace name. All the formats, included in this library can be created by CFormatFactory.
//You can get a format of CLongFormat type, by making the following: Common::CFormat* format = CFormatFactory::Create("Common::CLongFormat");
bool RegisterFormat | ( | const TString & | formatName, | |
pfnCreate | f | |||
) | [inline, static] |
Registers a new format.
[in] | formatName | Name of the format |
[in] | f | Pointer to the function, that creates a format of the specified class. |
CFormat * Create | ( | const TString & | formatName | ) | [static] |
Creates a new format object by a string.
[in] | formatName | Format name used at registration. |
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |