Public Member Functions | |
virtual | ~CDatabase () |
void | CreateDatabaseL () |
void | ReadfromDatabaseL () |
void | WritetoDatabaseL () |
void | PeriodicReadFuncL () |
void | PeriodicWriteFuncL () |
Static Public Member Functions | |
static CDatabase * | NewL () |
static TInt | PeriodicReadL (TAny *aPtr) |
static TInt | PeriodicWriteL (TAny *aPtr) |
Protected Member Functions | |
void | ConstructL () |
This is a database class which is used by two different threads to demonstrate thread synchronization using a semaphore.
Definition at line 28 of file CDatabase.h.
CDatabase::~CDatabase | ( | ) | [virtual] |
Destructor
Definition at line 41 of file CDatabase.cpp.
CDatabase * CDatabase::NewL | ( | ) | [static] |
Definition at line 29 of file CDatabase.cpp.
void CDatabase::CreateDatabaseL | ( | ) |
Creates database in the store and create a table and add columns to it.
Definition at line 79 of file CDatabase.cpp.
void CDatabase::ReadfromDatabaseL | ( | ) |
This function is called by the ReaderThread in SemaphoreExample. It creates a console to display the data read from the database and starts a periodic function to read the database at an interval of 1 second.
Definition at line 220 of file CDatabase.cpp.
void CDatabase::WritetoDatabaseL | ( | ) |
This function is called by the WriteThread in the SemaphoreExample and it starts a periodic function to write data in the database at an interval of 1 sec.
Definition at line 135 of file CDatabase.cpp.
TInt CDatabase::PeriodicReadL | ( | TAny * | aPtr | ) | [static] |
The call back function associated with the CPeriodic object of the CDatabase class and is called by the ReadfromDatabaseL() function.
Definition at line 237 of file CDatabase.cpp.
void CDatabase::PeriodicReadFuncL | ( | ) |
This function is called periodically at an interval of 1 second, it opens the database , reads one row and displays the numbers to the console.
Definition at line 248 of file CDatabase.cpp.
TInt CDatabase::PeriodicWriteL | ( | TAny * | aPtr | ) | [static] |
The call back function associated with the CPeriodic object of the CDatabase class and is called by the WritetoDatabaseL() function.
Definition at line 145 of file CDatabase.cpp.
void CDatabase::PeriodicWriteFuncL | ( | ) |
This function is called periodically at an interval of 1 sec, it opens the database, inserts one row and fills it with integer values.
Definition at line 157 of file CDatabase.cpp.
void CDatabase::ConstructL | ( | ) | [protected] |
Constructs a CPeriodic object, a database , opens the global semaphore.
Definition at line 54 of file CDatabase.cpp.