Class: TurboRex::MSRPC::RPCFinder::Collection
- Inherits:
-
Object
- Object
- TurboRex::MSRPC::RPCFinder::Collection
- Defined in:
- lib/turborex/msrpc/rpcfinder.rb
Instance Attribute Summary collapse
-
#client_interfaces ⇒ Object
readonly
Returns the value of attribute client_interfaces.
-
#server_interfaces ⇒ Object
readonly
Returns the value of attribute server_interfaces.
Instance Method Summary collapse
- #draw_xrefs ⇒ Object
- #find_by_interface_id(id, filter = nil) ⇒ Object
- #find_by_midl_switches(*switches) ⇒ Object
- #find_by_routine(routine) ⇒ Object
- #find_client_by_server(server) ⇒ Object
- #find_server_by_client(client) ⇒ Object
-
#initialize ⇒ Collection
constructor
A new instance of Collection.
- #push_client(i) ⇒ Object
- #push_server(i) ⇒ Object
Constructor Details
#initialize ⇒ Collection
Returns a new instance of Collection.
72 73 74 75 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 72 def initialize @server_interfaces = [] @client_interfaces = [] end |
Instance Attribute Details
#client_interfaces ⇒ Object (readonly)
Returns the value of attribute client_interfaces.
70 71 72 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 70 def client_interfaces @client_interfaces end |
#server_interfaces ⇒ Object (readonly)
Returns the value of attribute server_interfaces.
69 70 71 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 69 def server_interfaces @server_interfaces end |
Instance Method Details
#draw_xrefs ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 85 def draw_xrefs @server_interfaces.each do |si| ci = find_client_by_server(si) next if ci.empty? si.xrefs_to << ci ci.xrefs_from << si si.uniq! ci.uniq! end true end |
#find_by_interface_id(id, filter = nil) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 108 def find_by_interface_id(id, filter = nil) case filter when nil @server_interfaces.select { |i| i.interface_id == id } + \ @client_interfaces.select { |i| i.interface_id == id } when :server @server_interfaces.select { |i| i.interface_id == id } when :client @client_interfaces.select { |i| i.interface_id == id } end end |
#find_by_midl_switches(*switches) ⇒ Object
125 126 127 128 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 125 def find_by_midl_switches(*switches) @server_interfaces.select { |i| i.midl_switches.has_one_of_switches?(switches) } + \ @client_interfaces.select { |i| i.midl_switches.has_one_of_switches?(switches) } end |
#find_by_routine(routine) ⇒ Object
120 121 122 123 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 120 def find_by_routine(routine) @server_interfaces.select { |i| i.routines.include?(routine) } + \ @client_interfaces.select { |i| i.routines.include?(routine) } end |
#find_client_by_server(server) ⇒ Object
104 105 106 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 104 def find_client_by_server(server) @client_interfaces.select { |i| i.interface_id == server.interface_id } end |
#find_server_by_client(client) ⇒ Object
100 101 102 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 100 def find_server_by_client(client) @server_interfaces.select { |i| i.interface_id == client.interface_id } end |
#push_client(i) ⇒ Object
81 82 83 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 81 def push_client(i) @client_interfaces << i end |
#push_server(i) ⇒ Object
77 78 79 |
# File 'lib/turborex/msrpc/rpcfinder.rb', line 77 def push_server(i) @server_interfaces << i end |