Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 1 | /* |
| 2 | * @author: ucla-cs |
| 3 | * This class represents Exclude Component OBjects |
| 4 | */ |
| 5 | |
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame^] | 6 | var ExcludeComponent = function ExcludeComponent(_body) { |
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 7 | |
| 8 | //TODO Check BODY is an Array of componenets. |
| 9 | |
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame^] | 10 | this.body = _body |
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 11 | }; |
| 12 | |
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame^] | 13 | ExcludeComponent.prototype.from_ccnb = function( decoder) { |
| 14 | this.body = decoder.readBinaryElement(this.getElementLabel()); |
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 15 | }; |
| 16 | |
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame^] | 17 | ExcludeComponent.prototype.to_ccnb = function(encoder) { |
| 18 | encoder.writeElement(this.getElementLabel(), this.body); |
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 19 | }; |
| 20 | |
| 21 | ExcludeComponent.prototype.getElementLabel = function() { return CCNProtocolDTags.Component; }; |
| 22 | |