#include <assignmentvisitor.h>
Public Member Functions | |
| AssignmentVisitor () | |
| virtual | ~AssignmentVisitor () |
| bool | assign (IncidenceBase *target, const IncidenceBase *source) |
| virtual bool | visit (Event *event) |
| virtual bool | visit (Todo *todo) |
| virtual bool | visit (Journal *journal) |
| virtual bool | visit (FreeBusy *freebusy) |
Public Member Functions inherited from KCal::IncidenceBase::Visitor | |
| virtual | ~Visitor () |
| virtual bool | visit (Event *) |
| virtual bool | visit (Todo *) |
| virtual bool | visit (Journal *) |
| virtual bool | visit (FreeBusy *) |
Additional Inherited Members | |
Protected Member Functions inherited from KCal::IncidenceBase::Visitor | |
| Visitor () | |
Detailed Description
Helper for type correct assignment of incidences via pointers.
This class provides a way of correctly assigning one incidence to another, given two IncidenceBase derived pointers. It effectively provides a virtual assignment method which first type checks the two pointers to ensure they reference the same incidence type, before performing the assignment.
Usage example:
Definition at line 50 of file assignmentvisitor.h.
Constructor & Destructor Documentation
◆ AssignmentVisitor()
| AssignmentVisitor::AssignmentVisitor | ( | ) |
Creates a visitor instance.
Definition at line 40 of file assignmentvisitor.cpp.
◆ ~AssignmentVisitor()
|
virtual |
Destroys the instance.
Definition at line 44 of file assignmentvisitor.cpp.
Member Function Documentation
◆ assign()
| bool AssignmentVisitor::assign | ( | IncidenceBase * | target, |
| const IncidenceBase * | source | ||
| ) |
Assigns the incidence referenced by source to the incidence referenced by target, first ensuring that the source incidence can be cast to the same class as the target incidence.
Basically it is a virtual equivalent of
- Parameters
-
target pointer to the instance to assign to source pointer to the instance to assign from
- Returns
falseif the two objects are of different type
Definition at line 49 of file assignmentvisitor.cpp.
◆ visit() [1/4]
|
virtual |
Tries to assign to the given event, using the source passed to assign().
Reimplemented from KCal::IncidenceBase::Visitor.
Definition at line 63 of file assignmentvisitor.cpp.
◆ visit() [2/4]
|
virtual |
Tries to assign to the given freebusy, using the source passed to assign().
Reimplemented from KCal::IncidenceBase::Visitor.
Definition at line 108 of file assignmentvisitor.cpp.
◆ visit() [3/4]
|
virtual |
Tries to assign to the given journal, using the source passed to assign().
Reimplemented from KCal::IncidenceBase::Visitor.
Definition at line 93 of file assignmentvisitor.cpp.
◆ visit() [4/4]
|
virtual |
Tries to assign to the given todo, using the source passed to assign().
Reimplemented from KCal::IncidenceBase::Visitor.
Definition at line 78 of file assignmentvisitor.cpp.
The documentation for this class was generated from the following files:

Public Member Functions inherited from