Hi:
=20
I have a sample file for a dll I am trying to document. I thought that
it would be good to maintain the actual class descriptions in the =
sample
file rather then in the headers or in the implementation files. It =
works
for the CeField and CeItem class only. Does any-one have any idea why?
=20
thanks
=20
Rich
=20
=20
/*! \fn errReport
\brief log something
=20
C style binding to the error api this is just used as is (no new
abstraction)
*/
=20
CString sMess("Hello from our friend");
errReport( SEVERITY_INFO,
ROLE_ERROR_INFO,sMess.Left(ERRAPI_MAX_ERROR_LENGTH));
=20
/*! \class CeField
\brief a field entity
=20
A CeField is the type of the basic element in the framework. It is =
a
variant based on an integer, string, date or blob. It has operators to
coerce it into the other types. It is used by items and by the monitor
to hold elements of information.
*/
CeField fTest =3D 1;
=20
int i =3D fTest;
CString sTest =3D fTest;
/*! \class CeItem
\brief a record entity
=20
A CeItem is a collection of fields. It can be any database record,
returned as the result of a database query. An item has update and
insert methods as well, which may be of use in the framework. It has an
[] operator to dereference the fields.
*/
=20
CeItem iTest;
iTest["test"] =3D 1;
iTest["tool"] =3D 2;
iTest.dumpMap(0);
iTest["test"] =3D CString("3");
iTest.dumpMap(0);
=20
int j =3D iTest["test"];
CeItem *pTest =3D &iTest;
int k =3D (*pTest)["tool"];
=20
cout << (LPCSTR)iTest["test"] << endl;
=20
/*! \class CMonitor
\brief the context=20
=20
The monitor provides much of the context for an application. The
context is stored in fields which can be dereferenced by an [] =
operator.
The monitor is a singleton. This means that it can only be instantiated
once and that it has a static method which returns an instance of
itself. The method is invoked as such: Cmonitor::instance();
*/
CMonitor theMon(NULL, NULL);
theMon.getString("test");
=20
/*! \class CExtDatabase
\brief interface to ODBC data source
=20
The main extension to a CDatabase is nest-able database
transactions. There is also support for precompiled sql which is used =
by
the CeItemList.
*/
=20
=20
CExtDatabase m_dbRef;
m_dbRef.OpenEx("DSN=3Dmodeltest.localhost");
=20
/*! \class CODBCItemList
\brief list of database items
A collection of CeIItems. An ODBCItemList also has a CExtDatabase. =
The
main points of interest are some iteration macros as well as the query
and do methods which take sql with bind-variables and a list of fields
to use in the execution of the sql.
*/
=20
=20
CODBCItemList lTest(&m_dbRef, &m_dbRef);
lTest.query("select * from uowattribute where interaction =3D ?", -1,
-1, &CeField(743));
FOR_EACH(lTest, CeItem*, pItem)
{
cout << (LPCSTR)(*pItem)["uowid"] << endl;
}
END_FOR;
m_dbRef.Do("insert into tab(tname) values(?)", &CeField("test"));
lTest.emptyAll();
lTest.query("select tname from tab");
FOR_EACH(lTest, CeItem*, pItem)
{
cout << (LPCSTR)(*pItem)["tname"] << endl;
}
END_FOR;
=20
m_dbRef.Do("delete from tab where tname =3D ?", &CeField("test"));
=20
const char* szInitServerName =3D (const
char*)theMon.getService("IESS_SERVICE").ServiceStnName;
const char* szInitServiceName =3D (const
char*)theMon.getService("IESS_SERVICE").ServiceName;
const char* szInitAppClassName =3D (const =
char*)theMon["AppClassName"];
const char* szInitAppTypeName =3D (const =
char*)theMon["AppTypeName"];
=20
/*! \class CValidatorSS
=20
An abstraction of the sort simulator. Parses and finds distribution
of codelines and items.
*/
=20
CValidatorSS *m_pSortSimulator =3D new CValidatorSS(szInitServerName,
szInitServiceName,
szInitAppClassName,
szInitAppTypeName);
=20
m_pSortSimulator->OnNewParameterSet(1);
iTest["field1"] =3D "1000";
iTest["field2"] =3D "01";
iTest["field3"] =3D "100000090";
iTest["field4"] =3D "222222226";
int FieldInError;
short int Distribution, Classification;
m_pSortSimulator->Validate(&iTest, FieldInError, Distribution,
Classification);
=20
delete m_pSortSimulator;
=20
=20
|