blob: e208b826d0ff762b2922972c68977d6548261cc1 [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>
7#include "WireFormat.hpp"
8
9using namespace std;
10
11namespace ndn {
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070012
Jeff Thompson535f21a2013-08-05 18:25:46 -070013ptr_lib::shared_ptr<WireFormat> WireFormat::initialDefaultWireFormat_;
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070014
Jeff Thompson535f21a2013-08-05 18:25:46 -070015WireFormat *WireFormat::defaultWireFormat_ = 0;
16
17WireFormat *WireFormat::getDefaultWireFormat()
18{
19 if (!defaultWireFormat_ && !initialDefaultWireFormat_) {
20 // There is no defaultWireFormat_ and we have not yet initialized initialDefaultWireFormat_, so initialize and use it.
21 // NOTE: This could have been done with a static initializer on initialDefaultWireFormat_, but this does not have
22 // good cross-platform support, especially for dynamic shared libraries.
23 initialDefaultWireFormat_.reset(newInitialDefaultWireFormat());
24 defaultWireFormat_ = initialDefaultWireFormat_.get();
25 }
26
27 return defaultWireFormat_;
28}
Jeff Thompsonfa181ac2013-08-02 19:00:51 -070029
Jeff Thompsonb0979fd2013-07-30 15:48:21 -070030ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeInterest(const Interest &interest)
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070031{
32 throw logic_error("unimplemented");
33}
Jeff Thompson42380712013-06-28 10:59:33 -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 Thompson56ec9e22013-08-02 11:34:07 -070039ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeData(const Data &data)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070040{
41 throw logic_error("unimplemented");
42}
Jeff Thompson56ec9e22013-08-02 11:34:07 -070043void WireFormat::decodeData(Data &data, const unsigned char *input, unsigned int inputLength)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070044{
45 throw logic_error("unimplemented");
46}
47
Jeff Thompson9c41dfe2013-06-27 12:10:25 -070048}