blob: cf7890ecb3d8ff660f5387ebe01118ca67665a81 [file] [log] [blame]
Jeff Thompson47eecfc2013-07-07 22:56:46 -07001/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07002 * Copyright (C) 2013 Regents of the University of California.
3 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson47eecfc2013-07-07 22:56:46 -07004 * See COPYING for copyright and distribution information.
Jeff Thompson9c41dfe2013-06-27 12:10:25 -07005 */
6
7#include <stdexcept>
Jeff Thompson53412192013-08-06 13:35:50 -07008#include "wire-format.hpp"
Jeff Thompson9c41dfe2013-06-27 12:10:25 -07009
10using namespace std;
11
12namespace ndn {
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070013
Jeff Thompson1a1312d2013-08-05 19:08:35 -070014static bool gotInitialDefaultWireFormat = false;
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070015
Jeff Thompson0050abe2013-09-17 12:50:25 -070016WireFormat* WireFormat::defaultWireFormat_ = 0;
Jeff Thompson535f21a2013-08-05 18:25:46 -070017
Jeff Thompson0050abe2013-09-17 12:50:25 -070018WireFormat*
19WireFormat::getDefaultWireFormat()
Jeff Thompson535f21a2013-08-05 18:25:46 -070020{
Jeff Thompson1a1312d2013-08-05 19:08:35 -070021 if (!defaultWireFormat_ && !gotInitialDefaultWireFormat) {
Jeff Thompson535f21a2013-08-05 18:25:46 -070022 // There is no defaultWireFormat_ and we have not yet initialized initialDefaultWireFormat_, so initialize and use it.
Jeff Thompson1a1312d2013-08-05 19:08:35 -070023 gotInitialDefaultWireFormat = true;
24 // NOTE: This allocates one object which we never free for the life of the application.
25 defaultWireFormat_ = newInitialDefaultWireFormat();
Jeff Thompson535f21a2013-08-05 18:25:46 -070026 }
27
28 return defaultWireFormat_;
29}
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070030
Jeff Thompson0050abe2013-09-17 12:50:25 -070031Blob
32WireFormat::encodeInterest(const Interest& interest)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070033{
34 throw logic_error("unimplemented");
35}
36
Jeff Thompson0050abe2013-09-17 12:50:25 -070037void
Jeff Thompson97223af2013-09-24 17:01:27 -070038WireFormat::decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070039{
40 throw logic_error("unimplemented");
41}
Jeff Thompson0050abe2013-09-17 12:50:25 -070042
43Blob
Jeff Thompson97223af2013-09-24 17:01:27 -070044WireFormat::encodeData(const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Jeff Thompson0050abe2013-09-17 12:50:25 -070045{
46 throw logic_error("unimplemented");
47}
48
49void
50WireFormat::decodeData
Jeff Thompson97223af2013-09-24 17:01:27 -070051 (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070052{
53 throw logic_error("unimplemented");
54}
55
Jeff Thompson0050abe2013-09-17 12:50:25 -070056Blob
57WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry)
Jeff Thompson990599b2013-08-27 15:14:25 -070058{
59 throw logic_error("unimplemented");
60}
Jeff Thompson0050abe2013-09-17 12:50:25 -070061
62void
Jeff Thompson97223af2013-09-24 17:01:27 -070063WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength)
Jeff Thompson990599b2013-08-27 15:14:25 -070064{
65 throw logic_error("unimplemented");
66}
67
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070068}