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.
38 39 40 41 42 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 38 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.
33 34 35 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 33 def packet_factory @packet_factory end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
32 33 34 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 32 def protocol @protocol end |
#stores ⇒ Object (readonly)
Agent ID => PacketStore
36 37 38 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 36 def stores @stores end |
Instance Method Details
#add_agent(agt_id) ⇒ Object
44 45 46 47 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 44 def add_agent(agt_id) store = PacketStore.new(@protocol, @packet_factory); @stores[agt_id] = store; end |
#remove_agent(agt_id) ⇒ Object
49 50 51 |
# File 'lib/baykit/bayserver/protocol/packet_store.rb', line 49 def remove_agent(agt_id) @stores.delete(agt_id); end |