All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
validity-period-lite.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_VALIDITY_PERIOD_LITE_HPP
23 #define NDN_VALIDITY_PERIOD_LITE_HPP
24 
25 #include "../../c/security/validity-period-types.h"
26 
27 namespace ndn {
28 
34 public:
39 
45  bool
46  hasPeriod() const;
47 
52  ndn_MillisecondsSince1970
53  getNotBefore() const { return notBefore; }
54 
59  ndn_MillisecondsSince1970
60  getNotAfter() const { return notAfter; }
61 
64  void
65  clear();
66 
78  setPeriod
79  (ndn_MillisecondsSince1970 notBefore, ndn_MillisecondsSince1970 notAfter);
80 
86  bool
87  equals(const ValidityPeriodLite& other) const;
88 
95  bool
96  isValid(ndn_MillisecondsSince1970 time) const;
97 
103  static ValidityPeriodLite&
104  downCast(ndn_ValidityPeriod& validityPeriod) { return *(ValidityPeriodLite*)&validityPeriod; }
105 
106  static const ValidityPeriodLite&
107  downCast(const ndn_ValidityPeriod& validityPeriod) { return *(ValidityPeriodLite*)&validityPeriod; }
108 };
109 
110 }
111 
112 #endif
Copyright (C) 2016-2018 Regents of the University of California.
Definition: validity-period-types.h:34
bool equals(const ValidityPeriodLite &other) const
Check if this is the same validity period as other.
Definition: validity-period-lite.cpp:53
ndn_MillisecondsSince1970 notAfter
-DBL_MAX for none.
Definition: validity-period-types.h:36
ndn_MillisecondsSince1970 notBefore
DBL_MAX for none.
Definition: validity-period-types.h:35
ValidityPeriodLite()
Create a default ValidityPeriodLite where the period is not specified.
Definition: validity-period-lite.cpp:27
void clear()
Reset to a default ValidityPeriod where the period is not specified.
Definition: validity-period-lite.cpp:39
static ValidityPeriodLite & downCast(ndn_ValidityPeriod &validityPeriod)
Downcast the reference to the ndn_ValidityPeriod struct to a ValidityPeriodLite.
Definition: validity-period-lite.hpp:104
bool isValid(ndn_MillisecondsSince1970 time) const
Check if the time falls within the validity period.
Definition: validity-period-lite.cpp:59
ValidityPeriodLite & setPeriod(ndn_MillisecondsSince1970 notBefore, ndn_MillisecondsSince1970 notAfter)
Set the validity period.
Definition: validity-period-lite.cpp:46
ndn_MillisecondsSince1970 getNotAfter() const
Get the end of the validity period range.
Definition: validity-period-lite.hpp:60
ndn_MillisecondsSince1970 getNotBefore() const
Get the beginning of the validity period range.
Definition: validity-period-lite.hpp:53
bool hasPeriod() const
Check if the period has been set.
Definition: validity-period-lite.cpp:33
A ValidityPeriodLite is used in a Data packet's SignatureInfo and represents the begin and end times ...
Definition: validity-period-lite.hpp:33