Classified ads
Classes | Public Slots | Signals | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TrustTreeModel Class Reference

This is is part of datamodel for trust tree related operation. More...

#include <trusttreemodel.h>

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

Classes

struct  TrustTreeItemStruct
 

Public Slots

void contentReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfReceivdContent)
 

Signals

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

Public Member Functions

 TrustTreeModel (MController *aMController, const MModelProtocolInterface &aModel)
 
 ~TrustTreeModel ()
 
void offerTrustList (const Hash &aTrustListOwnerProfile, const QString &aOwnerProfileDisplayName, const QList< Hash > &aList)
 
bool isProfileTrusted (const Hash &aProfile, QString *aDisplayNameOfTrustingProfile, Hash *aFpOfTrustingProfile) const
 
void initModel (const QVariant &aPreviousSettings)
 
QVariant trustTreeSettings () const
 
void clear (void)
 

Private Types

typedef struct TrustTreeModel::TrustTreeItemStruct TrustTreeItem
 

Private Member Functions

void recalculateTrust ()
 
void setProfileTrustedInList (const Hash &aTrustedProfile, const Hash &aTrustingProfile, int aLevel)
 

Private Attributes

MControlleriController
 
const MModelProtocolInterfaceiModel
 
QMap< Hash, TrustTreeItem > * iTrustTree
 
unsigned iLastUpdateTime
 

Detailed Description

This is is part of datamodel for trust tree related operation.

Trust list of part of operator profile. Simple as that. This class contains algorithms manipulating a tree constructed from lists of operators where operators expores (dis)trust of each others in complex web of nodes and vertices. Main goal is fast query about trustworthiness of given operator profile.

Classified ads treats trust as boolean ; operator either is trusted or not. There is no distinction between recognizing the operators identity and assigning trust to her - if operator is trusted it must mean both at the same time: trusted operator is identified at least somehow and in addition is recognized as trustworthy animal, person or bot.

Output is also boolean. There are algorithms for producing floating point numbers for this purpose .. say, half of your trusted friends give some unknown operator "true" for trust, the other half does not (either recognize or trust) so you could decide that his operator enjoys some 50% trustworthiness - this is not done. Motivation is simplicity both in concept and algorithms, the floating point methods tend to be computationally rather expensive.

Member Typedef Documentation

internal trust list item

Constructor & Destructor Documentation

TrustTreeModel::TrustTreeModel ( MController aMController,
const MModelProtocolInterface aModel 
)
TrustTreeModel::~TrustTreeModel ( )

Member Function Documentation

void TrustTreeModel::clear ( void  )

method for emptying model contents in event of profile change

void TrustTreeModel::contentReceived ( const Hash aHashOfContent,
const ProtocolItemType  aTypeOfReceivdContent 
)
slot

activated when new profile is received

void TrustTreeModel::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal
void TrustTreeModel::initModel ( const QVariant &  aPreviousSettings)

method for initializing the model when profile changes

Parameters
aPreviousSettingssettings previously obtained using trustTreeSettings method
bool TrustTreeModel::isProfileTrusted ( const Hash aProfile,
QString *  aDisplayNameOfTrustingProfile,
Hash aFpOfTrustingProfile 
) const

Method for making a query about a profile.

Parameters
aProfilefingerprint of the profile queried
aDisplayNameOfTrustingProfilepointer to string that, if non-null, in case of this method returns true, will have its value set to display-name of some profile that trusts aProfile
aFpOfTrustingProfilebehaves the same way as aDisplayNameOfTrustingProfile but instead of display-name carries a fingerprint
Returns
true if profile is trusted.
void TrustTreeModel::offerTrustList ( const Hash aTrustListOwnerProfile,
const QString &  aOwnerProfileDisplayName,
const QList< Hash > &  aList 
)

method for injecting a trust list into model. This is called when there is suspicion that trust list of a profile may have been changed and this causes re-calculation of the trust tree

Parameters
aTrustListOwnerProfilefingerprint of profile whose list is about to get processed
aOwnerProfileDisplayNamehuman-readable name for the profile
aListis the list. This is a list of fingerprints of other profiles that aTrustListOwnerProfile indicates to be trustworthy.
void TrustTreeModel::recalculateTrust ( )
private

method that takes contents of iTrustTree and if there is any additions etc. takes them into account

void TrustTreeModel::setProfileTrustedInList ( const Hash aTrustedProfile,
const Hash aTrustingProfile,
int  aLevel 
)
private

sets profile trusted in trust list. called from recalculateTrust

QVariant TrustTreeModel::trustTreeSettings ( ) const

Method that exports model state as QVariant.

Member Data Documentation

MController& TrustTreeModel::iController
private
unsigned TrustTreeModel::iLastUpdateTime
private
const MModelProtocolInterface& TrustTreeModel::iModel
private
QMap<Hash, TrustTreeItem>* TrustTreeModel::iTrustTree
private

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