Classified ads
Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TclCallbacks Class Reference

Class implementing TCL interpreter callbacks. More...

#include <tclCallbacks.h>

Inheritance diagram for TclCallbacks:
Inheritance graph
[legend]
Collaboration diagram for TclCallbacks:
Collaboration graph
[legend]

Signals

void error (MController::CAErrorSituation aError, const QString &aExplanation)
 

Public Member Functions

 TclCallbacks (Model &aModel, MController &aController)
 
 ~TclCallbacks ()
 
int getBinaryFileCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int getDbRecordCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 non-static method for db record More...
 
int getProfileCommentCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int getClassifiedAdCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int getProfileCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int listItemsCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int publishItemCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int storeTCLProgLocalDataImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int retrieveTCLProgLocalDataImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int isProfileTrustedImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int saveFileImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int openFileImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 

Private Member Functions

int publishProfileCommentCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int publishFileCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int publishProfileCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int publishClassifiedAdCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 
int publishDbRecordCmdImpl (ClientData aCData, Tcl_Interp *aInterp, int aObjc, Tcl_Obj *const aObjv[])
 

Private Attributes

ModeliModel
 
MControlleriController
 

Detailed Description

Class implementing TCL interpreter callbacks.

This class is closely coupled with TclWrapper class and the TCL interpreter instantiated by TclWrapper will use command-callbacks implemented by this class.

Constructor & Destructor Documentation

◆ TclCallbacks()

TclCallbacks::TclCallbacks ( Model aModel,
MController aController 
)

◆ ~TclCallbacks()

TclCallbacks::~TclCallbacks ( )

Destructor

Member Function Documentation

◆ error

void TclCallbacks::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal

◆ getBinaryFileCmdImpl()

int TclCallbacks::getBinaryFileCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

non-static method for getting binary file

◆ getClassifiedAdCmdImpl()

int TclCallbacks::getClassifiedAdCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

non-static method for getting classified ad

◆ getDbRecordCmdImpl()

int TclCallbacks::getDbRecordCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

non-static method for db record

Parameters
aObjvshould contain dictionary expressing the search conditions. Same dictionary keys are used that are in use when db record is published from TCL app.
Returns
If db records satisfying the conditions were found from local storage, they're returned synchronously as return value to this call, using Tcl_SetObjResult mechanism. Search is sent to remote nodes also and as remote nodes return search results, new db records may be added to database and TCL app running may receive notifications later concerning db records originally queries but arriving later.
Parameters
returnTCL_OK if ok, the actual TCL object returned is a TCL dictionary.

◆ getProfileCmdImpl()

int TclCallbacks::getProfileCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

non-static method for getting profile details

◆ getProfileCommentCmdImpl()

int TclCallbacks::getProfileCommentCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

non-static method for getting profile comment

◆ isProfileTrustedImpl()

int TclCallbacks::isProfileTrustedImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Tcl extension method for checking operator from trust-tree

Parameters
aCDataclientdata from tcl interpreter. Not used.
aInterppointer to calling TCL interpreter
aObjcnumber of items in array aObjv
aObjvcommand arguments.
Returns
TCL_OK on success.

◆ listItemsCmdImpl()

int TclCallbacks::listItemsCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Non-static Tcl extension method: when TCL scripts asks for list of profiles, it invokes this method. See where this method is added into TCL interpreters repertoire. Called from listItemsCmd method.

◆ openFileImpl()

int TclCallbacks::openFileImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Tcl extension method for returning contents of a file system file to interpreter. User gets to choose which file to read.

Parameters
aCDataclientdata from tcl interpreter. Not used.
aInterppointer to calling TCL interpreter
aObjcnumber of items in array aObjv
aObjvcommand arguments.
Returns
TCL_OK on success.

◆ publishClassifiedAdCmdImpl()

int TclCallbacks::publishClassifiedAdCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)
private

non-static method for publishing a classified ad

◆ publishDbRecordCmdImpl()

int TclCallbacks::publishDbRecordCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)
private

non-static method for publishing a db record

◆ publishFileCmdImpl()

int TclCallbacks::publishFileCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)
private

work-horse method for publishing a binary file. See method publishItemCmdImpl that calls this.

◆ publishItemCmdImpl()

int TclCallbacks::publishItemCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Tcl extension method for publishing an item. This will be called by several in-TCL commands, for instance "publishFile", "publishComment" or "publishProfile". The TCL command will be in aObjv[0] and aObjv[1] will contain the actual object to be published.

This is the non-static-version, see also TclWrapper::publishItemCmd.

Parameters
aCDataclientdata from tcl interpreter. Not used.
aInterppointer to calling TCL interpreter
aObjcnumber of items in array aObjv
aObjvcommand arguments. First is name of the command itself, like "publishFile", 2nd is actual object
Returns
TCL_OK on success.

◆ publishProfileCmdImpl()

int TclCallbacks::publishProfileCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)
private

non-static method for publishing a profile

◆ publishProfileCommentCmdImpl()

int TclCallbacks::publishProfileCommentCmdImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)
private

work-horse method for publishing a profile comment. See method publishItemCmdImpl that calls this.

◆ retrieveTCLProgLocalDataImpl()

int TclCallbacks::retrieveTCLProgLocalDataImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Tcl extension method for retrieving back a blob previously stored using storeTCLProgLocalDataImpl.

This is the non-static-version, see also TclWrapper::retrieveTCLProgLocalDataCmd. In practice this calls TclModel::retrieveTCLProgLocalData.

Parameters
aCDataclientdata from tcl interpreter. Not used.
aInterppointer to calling TCL interpreter
aObjcnumber of items in array aObjv
aObjvcommand arguments.
Returns
TCL_OK on success.

◆ saveFileImpl()

int TclCallbacks::saveFileImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Tcl extension method for saving a file into filesystem. User gets to choose file name

Parameters
aCDataclientdata from tcl interpreter. Not used.
aInterppointer to calling TCL interpreter
aObjcnumber of items in array aObjv
aObjvcommand arguments.
Returns
TCL_OK on success.

◆ storeTCLProgLocalDataImpl()

int TclCallbacks::storeTCLProgLocalDataImpl ( ClientData  aCData,
Tcl_Interp *  aInterp,
int  aObjc,
Tcl_Obj *const  aObjv[] 
)

Tcl extension method for storing a blob of data in local storage

This is the non-static-version, see also TclWrapper::storeTCLProgLocalDataCmd. In practice this calls TclModel::storeTCLProgLocalData.

Parameters
aCDataclientdata from tcl interpreter. Not used.
aInterppointer to calling TCL interpreter
aObjcnumber of items in array aObjv
aObjvcommand arguments. First is name of the command itself, 2nd is the data to be stored
Returns
TCL_OK on success.

Member Data Documentation

◆ iController

MController& TclCallbacks::iController
private

◆ iModel

Model& TclCallbacks::iModel
private

datamodel reference


The documentation for this class was generated from the following file: