blob: 450f3e0c4dca951e1ac832cc46d1cc13da43682a [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 Thompson535f21a2013-08-05 18:25:46 -070016WireFormat *WireFormat::defaultWireFormat_ = 0;
17
18WireFormat *WireFormat::getDefaultWireFormat()
19{
Jeff Thompson1a1312d2013-08-05 19:08:35 -070020 if (!defaultWireFormat_ && !gotInitialDefaultWireFormat) {
Jeff Thompson535f21a2013-08-05 18:25:46 -070021 // There is no defaultWireFormat_ and we have not yet initialized initialDefaultWireFormat_, so initialize and use it.
Jeff Thompson1a1312d2013-08-05 19:08:35 -070022 gotInitialDefaultWireFormat = true;
23 // NOTE: This allocates one object which we never free for the life of the application.
24 defaultWireFormat_ = newInitialDefaultWireFormat();
Jeff Thompson535f21a2013-08-05 18:25:46 -070025 }
26
27 return defaultWireFormat_;
28}
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070029
Jeff Thompsonc2b7b142013-09-12 15:29:04 -070030Blob WireFormat::encodeInterest(const Interest& interest)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070031{
32 throw logic_error("unimplemented");
33}
Jeff Thompson1656e6a2013-08-29 18:01:48 -070034void WireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070035{
36 throw logic_error("unimplemented");
37}
38
Jeff Thompsonc2b7b142013-09-12 15:29:04 -070039Blob WireFormat::encodeData(const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070040{
41 throw logic_error("unimplemented");
42}
Jeff Thompsonc87f39a2013-08-12 11:55:11 -070043void WireFormat::decodeData
Jeff Thompson1656e6a2013-08-29 18:01:48 -070044 (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070045{
46 throw logic_error("unimplemented");
47}
48
Jeff Thompsonc2b7b142013-09-12 15:29:04 -070049Blob WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry)
Jeff Thompson990599b2013-08-27 15:14:25 -070050{
51 throw logic_error("unimplemented");
52}
Jeff Thompson1656e6a2013-08-29 18:01:48 -070053void WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength)
Jeff Thompson990599b2013-08-27 15:14:25 -070054{
55 throw logic_error("unimplemented");
56}
57
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070058}