blob: ced4c1833e207ce66f1b1a46550a8c16a4ad4e23 [file] [log] [blame]
Jeff Thompson47eecfc2013-07-07 22:56:46 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
Jeff Thompson9c41dfe2013-06-27 12:10:25 -07004 */
5
6#include <stdexcept>
Jeff Thompson53412192013-08-06 13:35:50 -07007#include "wire-format.hpp"
Jeff Thompson9c41dfe2013-06-27 12:10:25 -07008
9using namespace std;
10
11namespace ndn {
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070012
Jeff Thompson1a1312d2013-08-05 19:08:35 -070013static bool gotInitialDefaultWireFormat = false;
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070014
Jeff Thompson535f21a2013-08-05 18:25:46 -070015WireFormat *WireFormat::defaultWireFormat_ = 0;
16
17WireFormat *WireFormat::getDefaultWireFormat()
18{
Jeff Thompson1a1312d2013-08-05 19:08:35 -070019 if (!defaultWireFormat_ && !gotInitialDefaultWireFormat) {
Jeff Thompson535f21a2013-08-05 18:25:46 -070020 // There is no defaultWireFormat_ and we have not yet initialized initialDefaultWireFormat_, so initialize and use it.
Jeff Thompson1a1312d2013-08-05 19:08:35 -070021 gotInitialDefaultWireFormat = true;
22 // NOTE: This allocates one object which we never free for the life of the application.
23 defaultWireFormat_ = newInitialDefaultWireFormat();
Jeff Thompson535f21a2013-08-05 18:25:46 -070024 }
25
26 return defaultWireFormat_;
27}
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070028
Jeff Thompsonc2b7b142013-09-12 15:29:04 -070029Blob WireFormat::encodeInterest(const Interest& interest)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070030{
31 throw logic_error("unimplemented");
32}
Jeff Thompson1656e6a2013-08-29 18:01:48 -070033void WireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070034{
35 throw logic_error("unimplemented");
36}
37
Jeff Thompsonc2b7b142013-09-12 15:29:04 -070038Blob WireFormat::encodeData(const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070039{
40 throw logic_error("unimplemented");
41}
Jeff Thompsonc87f39a2013-08-12 11:55:11 -070042void WireFormat::decodeData
Jeff Thompson1656e6a2013-08-29 18:01:48 -070043 (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070044{
45 throw logic_error("unimplemented");
46}
47
Jeff Thompsonc2b7b142013-09-12 15:29:04 -070048Blob WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry)
Jeff Thompson990599b2013-08-27 15:14:25 -070049{
50 throw logic_error("unimplemented");
51}
Jeff Thompson1656e6a2013-08-29 18:01:48 -070052void WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength)
Jeff Thompson990599b2013-08-27 15:14:25 -070053{
54 throw logic_error("unimplemented");
55}
56
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070057}