Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
ICalSpanList Class Reference

#include <icalspanlist_cxx.h>

List of all members.

Public Member Functions

 ICalSpanList (icalset *set, icaltimetype start, icaltimetype end) throw (icalerrorenum)
 Construct an ICalSpanList from an icalset.
 ICalSpanList (icalcomponent *comp) throw (icalerrorenum)
 Construct an ICalSpanList from the VFREEBUSY chunk of a icalcomponent.
 ICalSpanList (VComponent &comp) throw (icalerrorenum)
 Construct an ICalSpanList from the VFREEBUSY chunk of a vcomponent.
 ~ICalSpanList ()
 Destructor.
VComponentget_vfreebusy (const char *organizer, const char *attendee) throw (icalerrorenum)
 Return a VFREEBUSY icalcomponent.
 operator icalspanlist * ()
 Return the base data when casting.
std::vector< intas_vector (int delta_t) throw (icalerrorenum)
 Return a vector of the number of events over delta t.
void dump ()
 Dump the spanlist to stdout.

Private Attributes

icalspanlist * data

Detailed Description

Definition at line 23 of file icalspanlist_cxx.h.


Constructor & Destructor Documentation

ICalSpanList::ICalSpanList ( icalset *  set,
icaltimetype  start,
icaltimetype  end 
) throw (icalerrorenum)

Construct an ICalSpanList from an icalset.

Parameters:
setThe icalset containing the VEVENTS
startDesignated start of the spanlist
endDesignated end of the spanlist

Definition at line 10 of file icalspanlist_cxx.cpp.

{
  data = icalspanlist_new(set, start, end);
  if (!data) throw icalerrno;
};

Here is the call graph for this function:

ICalSpanList::ICalSpanList ( icalcomponent *  comp) throw (icalerrorenum)

Construct an ICalSpanList from the VFREEBUSY chunk of a icalcomponent.

Constructor.

Parameters:
compA valid icalcomponent with a VFREEBUSY section

Definition at line 21 of file icalspanlist_cxx.cpp.

{
  data = icalspanlist_from_vfreebusy(comp);
  if (!data) throw icalerrno;
}

Here is the call graph for this function:

Construct an ICalSpanList from the VFREEBUSY chunk of a vcomponent.

Constructor.

Parameters:
compA valid VComponent with a VFREEBUSY section

Definition at line 30 of file icalspanlist_cxx.cpp.

{
  data = icalspanlist_from_vfreebusy((icalcomponent*) comp);
  if (!data) throw icalerrno;
}

Here is the call graph for this function:

Destructor.

Definition at line 37 of file icalspanlist_cxx.cpp.

Here is the call graph for this function:


Member Function Documentation

Return a vector of the number of events over delta t.

Returns a summary of events over delta_t.

Parameters:
delta_tNumber of seconds to divide the spanlist time period into.

This method calculates the total number of events in each time slot of delta_t seconds.

See also:
icalspanlist_as_freebusy_matrix()

Definition at line 77 of file icalspanlist_cxx.cpp.

{
  int *matrix;
  int i = 0;
  std::vector<int> event_vec;

  matrix = icalspanlist_as_freebusy_matrix(data, delta_t);

  if (!matrix) throw ICAL_USAGE_ERROR;

  while (matrix[i] != -1) {
    event_vec.push_back(matrix[i]); // Add item at end of vector
  }
  
  return(event_vec);
}

Here is the call graph for this function:

void ICalSpanList::dump ( ) [inline]

Dump the spanlist to stdout.

Definition at line 47 of file icalspanlist_cxx.h.

Here is the call graph for this function:

VComponent * ICalSpanList::get_vfreebusy ( const char *  organizer,
const char *  attendee 
) throw (icalerrorenum)

Return a VFREEBUSY icalcomponent.

Returns a VFREEBUSY component for the object.

See also:
icalspanlist_as_vfreebusy()

Definition at line 50 of file icalspanlist_cxx.cpp.

{
  icalcomponent *comp;
  VComponent    *vcomp;

  comp = icalspanlist_as_vfreebusy(data, organizer, attendee);
  if (comp == 0) throw icalerrno;
    
  vcomp = new VComponent(comp);
  if (vcomp == 0) throw icalerrno;

  return vcomp;
}

Here is the call graph for this function:

ICalSpanList::operator icalspanlist * ( ) [inline]

Return the base data when casting.

Definition at line 41 of file icalspanlist_cxx.h.

{return data;}

Member Data Documentation

icalspanlist* ICalSpanList::data [private]

Definition at line 50 of file icalspanlist_cxx.h.


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