blob: 8751d16ce6ac02119ce24449bda7a990fa6ef491 [file] [log] [blame]
Jeff Thompson25b4e612013-10-10 16:03:24 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Jeff Thompson47eecfc2013-07-07 22:56:46 -07002/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07003 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson47eecfc2013-07-07 22:56:46 -07005 * See COPYING for copyright and distribution information.
Jeff Thompson9c41dfe2013-06-27 12:10:25 -07006 */
7
8#include <stdexcept>
Jeff Thompson25b4e612013-10-10 16:03:24 -07009#include <ndn-cpp/encoding/wire-format.hpp>
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070010
11using namespace std;
12
13namespace ndn {
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070014
Jeff Thompson1a1312d2013-08-05 19:08:35 -070015static bool gotInitialDefaultWireFormat = false;
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070016
Jeff Thompson0050abe2013-09-17 12:50:25 -070017WireFormat* WireFormat::defaultWireFormat_ = 0;
Jeff Thompson535f21a2013-08-05 18:25:46 -070018
Jeff Thompson0050abe2013-09-17 12:50:25 -070019WireFormat*
20WireFormat::getDefaultWireFormat()
Jeff Thompson535f21a2013-08-05 18:25:46 -070021{
Jeff Thompson1a1312d2013-08-05 19:08:35 -070022 if (!defaultWireFormat_ && !gotInitialDefaultWireFormat) {
Jeff Thompson535f21a2013-08-05 18:25:46 -070023 // There is no defaultWireFormat_ and we have not yet initialized initialDefaultWireFormat_, so initialize and use it.
Jeff Thompson1a1312d2013-08-05 19:08:35 -070024 gotInitialDefaultWireFormat = true;
25 // NOTE: This allocates one object which we never free for the life of the application.
26 defaultWireFormat_ = newInitialDefaultWireFormat();
Jeff Thompson535f21a2013-08-05 18:25:46 -070027 }
28
29 return defaultWireFormat_;
30}
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070031
Jeff Thompson0050abe2013-09-17 12:50:25 -070032Blob
33WireFormat::encodeInterest(const Interest& interest)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070034{
35 throw logic_error("unimplemented");
36}
37
Jeff Thompson0050abe2013-09-17 12:50:25 -070038void
Jeff Thompson97223af2013-09-24 17:01:27 -070039WireFormat::decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070040{
41 throw logic_error("unimplemented");
42}
Jeff Thompson0050abe2013-09-17 12:50:25 -070043
44Blob
Jeff Thompson97223af2013-09-24 17:01:27 -070045WireFormat::encodeData(const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Jeff Thompson0050abe2013-09-17 12:50:25 -070046{
47 throw logic_error("unimplemented");
48}
49
50void
51WireFormat::decodeData
Jeff Thompson97223af2013-09-24 17:01:27 -070052 (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070053{
54 throw logic_error("unimplemented");
55}
56
Jeff Thompson0050abe2013-09-17 12:50:25 -070057Blob
58WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry)
Jeff Thompson990599b2013-08-27 15:14:25 -070059{
60 throw logic_error("unimplemented");
61}
Jeff Thompson0050abe2013-09-17 12:50:25 -070062
63void
Jeff Thompson97223af2013-09-24 17:01:27 -070064WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength)
Jeff Thompson990599b2013-08-27 15:14:25 -070065{
66 throw logic_error("unimplemented");
67}
68
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070069}