OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB::PIMCalendarItemIndex Class Reference

Documentation for class PIMCalendarItemIndex. It implements PIMItemIndex for OpenAB::eEvent or OpenAB::eTask type, additionally allows to define which PIMItemCheck should be used to construct PIMCalendarItemIndex objects. More...

#include <PIMCalendarItemIndex.hpp>

Inheritance diagram for OpenAB::PIMCalendarItemIndex:
Collaboration diagram for OpenAB::PIMCalendarItemIndex:

Public Member Functions

 PIMCalendarItemIndex (PIMItemType t)
 Constructor. More...
 
virtual ~PIMCalendarItemIndex ()
 Destructor, virtual by default. More...
 
std::string toString () const
 Returns string version of PIMItemIndex. It contains only PIMItemCheck::eKey fields. More...
 
std::string toStringFull () const
 Returns string version of PIMItemIndex. It contains both PIMItemCheck::eKey and PIMItemCheck::eConflict fields. More...
 
bool operator== (const PIMItemIndex &other) const
 Compare operator. Checks if two PIMItemIndex matches (may not be exactly the same) More...
 
bool operator!= (const PIMItemIndex &other) const
 Compare operator. Checks if two PIMItemIndex not matches (are totally different) More...
 
bool operator< (const PIMItemIndex &other) const
 Compare operator. More...
 
bool compare (const PIMItemIndex &other) const
 Compares two PIMItemIndex object, checks if two PIMItemIndex are exactly the same. In opposite to compare operator it checks PIMItemCheck::eConflict fields. More...
 
- Public Member Functions inherited from OpenAB::PIMItemIndex
 PIMItemIndex (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~PIMItemIndex ()
 Destructor, virtual by default. More...
 
virtual void addKeyField (const std::string &name, const std::string &value)
 Adds new PIMItemCheck::eKey field. More...
 
virtual void addConflictField (const std::string &name, const std::string &value)
 Adds new PIMItemCheck::eConflict field. More...
 
OpenAB::PIMItemType getType () const
 Returns type of item that index is representing. More...
 

Static Public Member Functions

static bool addCheck (const std::string &fieldName, PIMItemCheck::eFieldRole role)
 Defines new PIMItemCheck for PIMCalendarItemIndex objects. More...
 
static bool removeCheck (const std::string &fieldName)
 Removes check for PIMCalendarItemIndex objects. More...
 
static void clearAllChecks ()
 Removes all defined PIMItemCheck for PIMCalendarItemIndex. More...
 
static std::vector< PIMItemCheckgetAllChecks ()
 Returns all defined PIMItemCheck for PIMCalendarItemIndex objects. More...
 

Protected Member Functions

virtual bool equal (const PIMItemIndex &other) const
 
virtual bool notEqual (const PIMItemIndex &other) const
 
virtual bool lessThan (const PIMItemIndex &other) const
 
virtual bool compareWith (const PIMItemIndex &other) const
 
- Protected Member Functions inherited from OpenAB::PIMItemIndex
bool compareVectors (const std::vector< std::string > &v1, const std::vector< std::string > &v2) const
 

Static Protected Attributes

static std::vector< PIMItemCheckfields_desc
 

Additional Inherited Members

- Protected Attributes inherited from OpenAB::PIMItemIndex
std::vector< std::string > key_fields
 
std::vector< std::string > conflict_fields
 
std::vector< std::string > key_fields_names
 
std::vector< std::string > conflict_fields_names
 
std::string cached_to_string
 

Detailed Description

Documentation for class PIMCalendarItemIndex. It implements PIMItemIndex for OpenAB::eEvent or OpenAB::eTask type, additionally allows to define which PIMItemCheck should be used to construct PIMCalendarItemIndex objects.

Constructor & Destructor Documentation

OpenAB::PIMCalendarItemIndex::PIMCalendarItemIndex ( PIMItemType  t)

Constructor.

OpenAB::PIMCalendarItemIndex::~PIMCalendarItemIndex ( )
virtual

Destructor, virtual by default.

Member Function Documentation

bool OpenAB::PIMCalendarItemIndex::addCheck ( const std::string &  fieldName,
PIMItemCheck::eFieldRole  role 
)
static

Defines new PIMItemCheck for PIMCalendarItemIndex objects.

Parameters
[in]fieldNamename of iCalendar field to be checked
[in]rolerole of field check
Returns
true if new check was added successfully, false if check for the same field already exists.
void OpenAB::PIMCalendarItemIndex::clearAllChecks ( )
static

Removes all defined PIMItemCheck for PIMCalendarItemIndex.

bool OpenAB::PIMCalendarItemIndex::compare ( const PIMItemIndex other) const
virtual

Compares two PIMItemIndex object, checks if two PIMItemIndex are exactly the same. In opposite to compare operator it checks PIMItemCheck::eConflict fields.

Note
PIMItemCheck::eKey fields are not checked by this function, assumption is made that items were compared using operator ==() before, and only matching items are tested using this function.
Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if all PIMItemCheck::eConflict fields are the same in both PIMItemIndex objects, false otherwise.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMCalendarItemIndex::compareWith ( const PIMItemIndex other) const
protectedvirtual
bool OpenAB::PIMCalendarItemIndex::equal ( const PIMItemIndex other) const
protectedvirtual
std::vector< PIMItemIndex::PIMItemCheck > OpenAB::PIMCalendarItemIndex::getAllChecks ( )
static

Returns all defined PIMItemCheck for PIMCalendarItemIndex objects.

Returns
all defined PIMItemCheck for PIMCalendarItemIndex objects.
bool OpenAB::PIMCalendarItemIndex::lessThan ( const PIMItemIndex other) const
protectedvirtual
bool OpenAB::PIMCalendarItemIndex::notEqual ( const PIMItemIndex other) const
protectedvirtual
bool OpenAB::PIMCalendarItemIndex::operator!= ( const PIMItemIndex other) const
virtual

Compare operator. Checks if two PIMItemIndex not matches (are totally different)

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if other PIMItemIndex is not of OpenAB::eEvent or OpenAB::eTask or any PIMItemCheck::eKey fields is different in both PIMItemIndex objects, false otherwise.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMCalendarItemIndex::operator< ( const PIMItemIndex other) const
virtual

Compare operator.

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if other PIMItemIndex is of OpenAB::eEvent or OpenAB::eTask type and if index should be sorted before other index, according to theirs PIMItemCheck::eKey fields alphabetic order.
Note
Required to be able to store PIMItemIndex objects in std::map containers.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMCalendarItemIndex::operator== ( const PIMItemIndex other) const
virtual

Compare operator. Checks if two PIMItemIndex matches (may not be exactly the same)

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if other PIMItemIndex is of OpenAB::eEvent or OpenAB::eTask type and all PIMItemCheck::eKey fields are the same in both PIMItemIndex objects, false otherwise.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMCalendarItemIndex::removeCheck ( const std::string &  fieldName)
static

Removes check for PIMCalendarItemIndex objects.

Parameters
[in]fieldNamename of iCalendar field
Returns
true if check was removed, false if it does not exist.
std::string OpenAB::PIMCalendarItemIndex::toString ( ) const
virtual

Returns string version of PIMItemIndex. It contains only PIMItemCheck::eKey fields.

Returns
string version of PIMItemIndex

Implements OpenAB::PIMItemIndex.

std::string OpenAB::PIMCalendarItemIndex::toStringFull ( ) const
virtual

Returns string version of PIMItemIndex. It contains both PIMItemCheck::eKey and PIMItemCheck::eConflict fields.

Returns
string version of PIMItemIndex

Implements OpenAB::PIMItemIndex.

Member Data Documentation

std::vector< PIMItemIndex::PIMItemCheck > OpenAB::PIMCalendarItemIndex::fields_desc
staticprotected

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