All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
ndn::Schedule Class Reference

Schedule is used to manage the times when a member can access data using two sets of RepetitiveInterval as follows. More...

#include <schedule.hpp>

Classes

class  Result
 

Public Member Functions

 Schedule ()
 Create a Schedule with empty whiteIntervalList and blackIntervalList.
 
ScheduleaddWhiteInterval (const ptr_lib::shared_ptr< RepetitiveInterval > &repetitiveInterval)
 Add the repetitiveInterval to the whiteIntervalList. More...
 
ScheduleaddBlackInterval (const ptr_lib::shared_ptr< RepetitiveInterval > &repetitiveInterval)
 Add the repetitiveInterval to the blackIntervalList. More...
 
Result getCoveringInterval (MillisecondsSince1970 timeStamp) const
 Get the interval that covers the time stamp. More...
 
Blob wireEncode () const
 Encode this Schedule. More...
 
void wireDecode (const uint8_t *input, size_t inputLength)
 Decode the input and update this Schedule. More...
 
void wireDecode (const std::vector< uint8_t > &input)
 Decode the input and update this Schedule. More...
 
void wireDecode (const Blob &input)
 Decode the input and update this Schedule. More...
 

Static Public Member Functions

static MillisecondsSince1970 fromIsoString (const std::string &dateString)
 
static std::string toIsoString (MillisecondsSince1970 msSince1970)
 

Detailed Description

Schedule is used to manage the times when a member can access data using two sets of RepetitiveInterval as follows.

whiteIntervalList is an ordered set for the times a member is allowed to access to data, and blackIntervalList is for the times a member is not allowed.

Note
This class is an experimental feature. The API may change.

Member Function Documentation

Schedule& ndn::Schedule::addBlackInterval ( const ptr_lib::shared_ptr< RepetitiveInterval > &  repetitiveInterval)
inline

Add the repetitiveInterval to the blackIntervalList.

Parameters
repetitiveIntervalThe RepetitiveInterval to add. If the list already contains the same RepetitiveInterval, this does nothing.
Returns
This Schedule so you can chain calls to add.
Schedule& ndn::Schedule::addWhiteInterval ( const ptr_lib::shared_ptr< RepetitiveInterval > &  repetitiveInterval)
inline

Add the repetitiveInterval to the whiteIntervalList.

Parameters
repetitiveIntervalThe RepetitiveInterval to add. If the list already contains the same RepetitiveInterval, this does nothing.
Returns
This Schedule so you can chain calls to add.
Schedule::Result ndn::Schedule::getCoveringInterval ( MillisecondsSince1970  timeStamp) const

Get the interval that covers the time stamp.

This iterates over the two repetitive interval sets and find the shortest interval that allows a group member to access the data. If there is no interval covering the time stamp, this returns false for isPositive and returns a negative interval.

Parameters
timeStampThe time stamp as milliseconds since Jan 1, 1970 UTC.
Returns
An object with fields (isPositive, interval) where isPositive is true if the returned interval is positive or false if negative, and interval is the Interval covering the time stamp, or a negative interval if not found.
void ndn::Schedule::wireDecode ( const uint8_t *  input,
size_t  inputLength 
)

Decode the input and update this Schedule.

Parameters
inputThe input byte array to be decoded.
inputLengthThe length of input.
void ndn::Schedule::wireDecode ( const std::vector< uint8_t > &  input)
inline

Decode the input and update this Schedule.

Parameters
inputThe input byte array to be decoded.
void ndn::Schedule::wireDecode ( const Blob input)
inline

Decode the input and update this Schedule.

Parameters
inputThe input byte array to be decoded as an immutable Blob.
Blob ndn::Schedule::wireEncode ( ) const

Encode this Schedule.

Returns
The encoded byte array.

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