Class: Codec::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/codec/base.rb

Direct Known Subclasses

BaseComposed, Bertlv, Bitmap, Fix, Packed, Prefixedlength, Tagged

Instance Method Summary collapse

Instance Method Details

#add_sub_codec(field_id, codec) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/codec/base.rb', line 12

def add_sub_codec(field_id,codec)
 if codec.nil?
   raise InitializeException, "Invalid codec reference in subcodec #{field_id} for codec #{@id}"
 end
  @subCodecs ||= {}
  @subCodecs[field_id] = codec 
end

#decode(buf, field) ⇒ Object



4
5
6
# File 'lib/codec/base.rb', line 4

def decode(buf,field)
  raise "Abstract Codec"
end

#encode(buf, field) ⇒ Object



8
9
10
# File 'lib/codec/base.rb', line 8

def encode(buf,field)
  raise "Abstract Codec"
end

#get_sub_codecsObject



20
21
22
# File 'lib/codec/base.rb', line 20

def get_sub_codecs
  return @subCodecs
end