blob: d723d932e91351f40ee22b7f2175218c94a1a2dd [file] [log] [blame]
Meki Cherkaouif441d3a2012-04-22 15:17:52 -07001/*
2 * @author: ucla-cs
3 * This class represents Exclude Component OBjects
4 */
5
Jeff Thompsone85ff1d2012-09-29 21:21:57 -07006var ExcludeComponent = function ExcludeComponent(_body) {
Meki Cherkaouif441d3a2012-04-22 15:17:52 -07007
8 //TODO Check BODY is an Array of componenets.
9
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070010 this.body = _body
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070011};
12
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070013ExcludeComponent.prototype.from_ccnb = function( decoder) {
14 this.body = decoder.readBinaryElement(this.getElementLabel());
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070015};
16
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070017ExcludeComponent.prototype.to_ccnb = function(encoder) {
18 encoder.writeElement(this.getElementLabel(), this.body);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070019};
20
21ExcludeComponent.prototype.getElementLabel = function() { return CCNProtocolDTags.Component; };
22