#include <TnFXSQLDB_ipc.h>
The implementation of this class is trickier than it might be due to needing to be compatible with Tn's capability infrastructure, but the bonus is that it makes it very flexible.
By default, TnFXSQLDBServer refuses to serve everything FX::TnFXSQLDB_ipc requests for security. You must add databases which can be served using addDatabase() which accepts patterns. If the pattern matches, the database is served.
Public Member Functions | |
TnFXSQLDBServer () | |
TnFXSQLDBServer & | addDatabase (const FXString &driverName, const FXString &dbname, const FXString &user="*", const QHostAddress &host=QHostAddress(), FXushort port=0) |
bool | removeDatabase (const FXString &driverName, const FXString &dbname, const FXString &user="*", const QHostAddress &host=QHostAddress(), FXushort port=0) |
FXIPCChannel::HandledCode | handleMsg (FXIPCMsg *msg) |
Protected Member Functions | |
FXIPCChannel * | channel () const throw () |
FXuint | msgChunk () const throw () |
FXuint | msgRouting () const throw () |
template<class msgchunk, class channel> | |
void | setIPCChannel (channel *_channel, FXuint addToMsgType=msgchunk::BaseCode, FXuint _routing=0) |
template<class msgacktype, class msgtype> | |
bool | sendMsg (msgacktype *FXRESTRICT msgack, msgtype *FXRESTRICT msg, FXuint waitfor=FXINFINITE) |
template<class msgacktype, class msgtype> | |
bool | sendMsg (msgacktype &msgack, msgtype &msg, FXuint waitfor=FXINFINITE) |
template<class msgtype> | |
bool | sendMsg (msgtype *msg) |
template<class msgtype> | |
bool | sendMsg (msgtype &msg) |
bool | getMsgAck (FXIPCMsg *FXRESTRICT msgack, FXIPCMsg *FXRESTRICT msg, FXuint waitfor=FXINFINITE) |
bool | getMsgAck (FXIPCMsg &msgack, FXIPCMsg &msg, FXuint waitfor=FXINFINITE) |
FX::TnFXSQLDBServer::TnFXSQLDBServer | ( | ) |
Instantiates a server of databases
TnFXSQLDBServer& FX::TnFXSQLDBServer::addDatabase | ( | const FXString & | driverName, | |
const FXString & | dbname, | |||
const FXString & | user = "*" , |
|||
const QHostAddress & | host = QHostAddress() , |
|||
FXushort | port = 0 | |||
) |
Adds a database which is allowed to be served. You can use wildcards in the driver name, database name and user according to fxfilematch() - see FX::QDir for more. A null host and port means match anything.
bool FX::TnFXSQLDBServer::removeDatabase | ( | const FXString & | driverName, | |
const FXString & | dbname, | |||
const FXString & | user = "*" , |
|||
const QHostAddress & | host = QHostAddress() , |
|||
FXushort | port = 0 | |||
) |
Removes a previously added database.
FXIPCChannel* FX::FXIPCChannelIndirector::channel | ( | ) | const throw () [inline, protected, inherited] |
Returns the channel this is using.
FXuint FX::FXIPCChannelIndirector::msgChunk | ( | ) | const throw () [inline, protected, inherited] |
Returns the message chunk this is using.
FXuint FX::FXIPCChannelIndirector::msgRouting | ( | ) | const throw () [inline, protected, inherited] |
Returns the routing this is using.
void FX::FXIPCChannelIndirector::setIPCChannel | ( | channel * | _channel, | |
FXuint | addToMsgType = msgchunk::BaseCode , |
|||
FXuint | _routing = 0 | |||
) | [inline, protected, inherited] |
Sets indirector to use the specified channel and message chunk, applying routing to all sent messages.
bool FX::FXIPCChannelIndirector::sendMsg | ( | msgacktype *FXRESTRICT | msgack, | |
msgtype *FXRESTRICT | msg, | |||
FXuint | waitfor = FXINFINITE | |||
) | [inline, protected, inherited] |
Sends a message via the previously set channel, applying the previously specified routing and adding the previously specified message chunk. See FX::FXIPCChannel::sendMsg()
References FXSTATIC_ASSERT.
bool FX::FXIPCChannelIndirector::getMsgAck | ( | FXIPCMsg *FXRESTRICT | msgack, | |
FXIPCMsg *FXRESTRICT | msg, | |||
FXuint | waitfor = FXINFINITE | |||
) | [inline, protected, inherited] |
Gets the ack for a message previously sent using sendMsg(). See FX::FXIPCChannel::getMsgAck().