Class: Baykit::BayServer::Protocol::PacketStore::ProtocolInfo
- Inherits:
-
Object
- Object
- Baykit::BayServer::Protocol::PacketStore::ProtocolInfo
- Defined in:
- lib/baykit/bayserver/protocol/packet_store.rb
Instance Attribute Summary collapse
-
#packet_factory ⇒ Object
readonly
Returns the value of attribute packet_factory.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#stores ⇒ Object
readonly
Agent ID => PacketStore.
Instance Method Summary collapse
- #add_agent(agt_id) ⇒ Object
-
#initialize(proto, pkt_factory) ⇒ ProtocolInfo
constructor
A new instance of ProtocolInfo.
- #remove_agent(agt_id) ⇒ Object
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_factory ⇒ Object (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 |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
33 34 35 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 33 def protocol @protocol end |
#stores ⇒ Object (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 |