publisher-public-key-digest.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_PUBLISHERPUBLICKEYDIGEST_HPP
23 #define NDN_PUBLISHERPUBLICKEYDIGEST_HPP
24 
25 #include <vector>
26 #include "common.hpp"
27 #include "util/blob.hpp"
28 
30 
31 namespace ndn {
32 
38 public:
40  : changeCount_(0)
41  {
42  }
43 
49  void
50  get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const;
51 
56  void
57  set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct);
58 
59  const Blob&
60  getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
61 
62  void
63  setPublisherPublicKeyDigest(const Blob& publisherPublicKeyDigest)
64  {
65  publisherPublicKeyDigest_ = publisherPublicKeyDigest;
66  ++changeCount_;
67  }
68 
72  void
74  {
75  publisherPublicKeyDigest_.reset();
76  ++changeCount_;
77  }
78 
83  uint64_t
84  getChangeCount() const { return changeCount_; }
85 
86 private:
87  Blob publisherPublicKeyDigest_;
88  uint64_t changeCount_;
89 };
90 
91 }
92 
93 #endif
struct ndn_Blob publisherPublicKeyDigest
A Blob whose value is a pointer to pre-allocated buffer.
Definition: publisher-public-key-digest-types.h:35
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
A PublisherPublicKeyDigest holds the publisher public key digest value, if any.
Definition: publisher-public-key-digest.hpp:37
Copyright (C) 2015 Regents of the University of California.
Definition: publisher-public-key-digest-types.h:34
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
void clear()
Clear the publisherPublicKeyDigest.
Definition: publisher-public-key-digest.hpp:73
uint64_t getChangeCount() const
Get the change count, which is incremented each time this object is changed.
Definition: publisher-public-key-digest.hpp:84
void set(const struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct)
Clear this PublisherPublicKeyDigest, and copy from the ndn_PublisherPublicKeyDigest struct...
Definition: publisher-public-key-digest.cpp:36