Class: Baykit::BayServer::Protocol::PacketStore::ProtocolInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/baykit/bayserver/protocol/packet_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proto, pkt_factory) ⇒ ProtocolInfo

Returns a new instance of ProtocolInfo.



39
40
41
42
43
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 39

def initialize(proto, pkt_factory)
  @protocol = proto
  @packet_factory = pkt_factory
  @stores = {}
end

Instance Attribute Details

#packet_factoryObject (readonly)

Returns the value of attribute packet_factory.



34
35
36
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 34

def packet_factory
  @packet_factory
end

#protocolObject (readonly)

Returns the value of attribute protocol.



33
34
35
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 33

def protocol
  @protocol
end

#storesObject (readonly)

Agent ID => PacketStore



37
38
39
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 37

def stores
  @stores
end

Instance Method Details

#add_agent(agt_id) ⇒ Object



45
46
47
48
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 45

def add_agent(agt_id)
  store = PacketStore.new(@protocol, @packet_factory);
  @stores[agt_id] = store;
end

#remove_agent(agt_id) ⇒ Object



50
51
52
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 50

def remove_agent(agt_id)
  @stores.delete(agt_id);
end