• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • KCal
  • ComparisonVisitor
Public Member Functions
KCal::ComparisonVisitor Class Reference

#include <comparisonvisitor.h>

Inheritance diagram for KCal::ComparisonVisitor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ComparisonVisitor ()
virtual ~ComparisonVisitor ()
bool compare (IncidenceBase *incidence, const IncidenceBase *reference)
virtual bool visit (Event *event)
virtual bool visit (Todo *todo)
virtual bool visit (Journal *journal)
virtual bool visit (FreeBusy *freebusy)

Detailed Description

Helper for type correct comparison of incidences via pointers.

This class provides a way of correctly comparing one incidence to another, given two IncidenceBase derived pointers. It effectively provides a virtual comparison method which first type checks the two pointers to ensure they reference the same incidence type, before performing the comparison.

Usage example:

  KCal::Incidence *incidence;          // assume this is set somewhere else
  KCal::Incidence *referenceIncidence; // assume this is set somewhere else

  KCal::ComparisonVisitor visitor;

  // compare
  if ( visitor.compare( incidence, referenceIncidence ) ) {
    // incidence and referenceIncidence point to identical incidences
  }
Author:
Ingo Klöcker <kloecker@kde.org>
Since:
4.3

Constructor & Destructor Documentation

ComparisonVisitor::ComparisonVisitor ( )

Creates a visitor instance.

Definition at line 37 of file comparisonvisitor.cpp.

ComparisonVisitor::~ComparisonVisitor ( ) [virtual]

Destroys the instance.

Definition at line 41 of file comparisonvisitor.cpp.


Member Function Documentation

bool ComparisonVisitor::compare ( IncidenceBase *  incidence,
const IncidenceBase *  reference 
)

Compares the incidence referenced by incidence to the incidence referenced by reference.

Returns true, if the incidence referenced by incidence is identical to the incidence referenced by reference. Also returns true, if incidence and reference are both 0.

Basically it is a virtual equivalent of

      *incidence == *reference
Parameters:
incidencepointer to the incidence to compare with the reference incidence
referencepointer to the reference incidence
Returns:
true if the two incidences are identical or both 0

Definition at line 46 of file comparisonvisitor.cpp.

bool ComparisonVisitor::visit ( Event *  event) [virtual]

Compares the event referenced by event to the incidence passed to compare().

Returns:
true if the event is identical to the reference incidence

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 57 of file comparisonvisitor.cpp.

bool ComparisonVisitor::visit ( Todo *  todo) [virtual]

Compares the todo referenced by todo to the incidence passed to compare().

Returns:
true if the todo is identical to the reference incidence

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 70 of file comparisonvisitor.cpp.

bool ComparisonVisitor::visit ( Journal *  journal) [virtual]

Compares the journal referenced by journal to the incidence passed to compare().

Returns:
true if the journal is identical to the reference incidence

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 83 of file comparisonvisitor.cpp.

bool ComparisonVisitor::visit ( FreeBusy *  freebusy) [virtual]

Compares the freebusy object referenced by freebusy to the incidence passed to compare().

Returns:
true if the freebusy object is identical to the reference incidence

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 96 of file comparisonvisitor.cpp.


The documentation for this class was generated from the following files:
  • comparisonvisitor.h
  • comparisonvisitor.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:10:06 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal