Public Member Functions | List of all members
ndn::ValidityPeriod Class Reference

A ValidityPeriod is used in a Data packet's SignatureInfo and represents the begin and end times of a certificate's validity period. More...

#include <validity-period.hpp>

Public Member Functions

 ValidityPeriod ()
 Create a default ValidityPeriod where the period is not specified.
 
bool hasPeriod () const
 Check if the period has been set. More...
 
MillisecondsSince1970 getNotBefore () const
 Get the beginning of the validity period range. More...
 
MillisecondsSince1970 getNotAfter () const
 Get the end of the validity period range. More...
 
void clear ()
 Reset to a default ValidityPeriod where the period is not specified.
 
ValidityPeriodsetPeriod (MillisecondsSince1970 notBefore, MillisecondsSince1970 notAfter)
 Set the validity period. More...
 
bool equals (const ValidityPeriod &other) const
 Check if this is the same validity period as other. More...
 
bool isValid (const MillisecondsSince1970 &time) const
 Check if the time falls within the validity period. More...
 
uint64_t getChangeCount () const
 Get the change count, which is incremented each time this object is changed. More...
 
void get (ValidityPeriodLite &validityPeriodLite) const
 Set validityPeriodLite to point to the values in this meta info object, without copying any memory. More...
 
void set (const ValidityPeriodLite &validityPeriodLite)
 Clear this meta info, and set the values by copying from validityPeriodLite. More...
 

Detailed Description

A ValidityPeriod is used in a Data packet's SignatureInfo and represents the begin and end times of a certificate's validity period.

Member Function Documentation

bool ndn::ValidityPeriod::equals ( const ValidityPeriod other) const
inline

Check if this is the same validity period as other.

Parameters
otherThe other ValidityPeriod to compare with.
Returns
True if the validity periods are equal.
void ndn::ValidityPeriod::get ( ValidityPeriodLite validityPeriodLite) const
inline

Set validityPeriodLite to point to the values in this meta info object, without copying any memory.

WARNING: The resulting pointers in validityPeriodLite are invalid after a further use of this object which could reallocate memory.

Parameters
validityPeriodLiteThe ValidityPeriodLite object which receives the values.
uint64_t ndn::ValidityPeriod::getChangeCount ( ) const
inline

Get the change count, which is incremented each time this object is changed.

Returns
The change count.
MillisecondsSince1970 ndn::ValidityPeriod::getNotAfter ( ) const
inline

Get the end of the validity period range.

Returns
The time as milliseconds since Jan 1, 1970 UTC.
MillisecondsSince1970 ndn::ValidityPeriod::getNotBefore ( ) const
inline

Get the beginning of the validity period range.

Returns
The time as milliseconds since Jan 1, 1970 UTC.
bool ndn::ValidityPeriod::hasPeriod ( ) const
inline

Check if the period has been set.

Returns
True if the period has been set, false if the period is not specified (after calling the default constructor or clear).
bool ndn::ValidityPeriod::isValid ( const MillisecondsSince1970 time) const
inline

Check if the time falls within the validity period.

Parameters
timeThe time to check as milliseconds since Jan 1, 1970 UTC.
Returns
True if the beginning of the validity period is less than or equal to time and time is less than or equal to the end of the validity period.
void ndn::ValidityPeriod::set ( const ValidityPeriodLite validityPeriodLite)
inline

Clear this meta info, and set the values by copying from validityPeriodLite.

Parameters
validityPeriodLiteA ValidityPeriodLite object.
ValidityPeriod& ndn::ValidityPeriod::setPeriod ( MillisecondsSince1970  notBefore,
MillisecondsSince1970  notAfter 
)
inline

Set the validity period.

Parameters
notBeforeThe beginning of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded up to the nearest whole second.
notAfterThe end of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded down to the nearest whole second.
Returns
This ValidityPeriod so that you can chain calls to update values.

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