indexing description: "Represents a pipe id" license: "MIT license (see ../../license.txt)" author: "Beat Strasser " date: "$Date$" revision: "$Revision$" class P2P_PIPE_ID inherit P2P_ID_UUID create make_from_urn, make, make_new_with_group feature {NONE} -- Initialization make (group_uuid, pipe_uuid: like bytes) is -- Create pipe id with `pipe_uuid' in peer group with `group_uuid' require Pipe_uuid_valid: pipe_uuid /= Void and pipe_uuid.count = uuid_bytes_count Group_uuid_valid: group_uuid /= Void and group_uuid.count = uuid_bytes_count do initialize_bytes bytes.subcopy (group_uuid, 0, uuid_bytes_count - 1, peer_group_uuid_msb) bytes.subcopy (pipe_uuid, 0, uuid_bytes_count - 1, pipe_uuid_msb) build_uuidformat end make_new_with_group (group_uuid: like bytes) is -- Create new pipe id with new uuid in peer group `group_uuid' require Group_uuid_valid: group_uuid /= Void and group_uuid.count = uuid_bytes_count do initialize_bytes bytes.subcopy (group_uuid, 0, uuid_bytes_count - 1, peer_group_uuid_msb) create_random_uuid (bytes, pipe_uuid_msb) build_uuidformat end feature -- Access flag_id_type: NATURAL_8 is 4 peer_group_id: P2P_PEERGROUP_UUID is -- Create peer group id do create Result.make_with_uuid (subbytes (peer_group_uuid_msb, peer_group_uuid_lsb)) ensure Result_set: Result /= Void end feature {NONE} -- Implementation Peer_group_uuid_msb: INTEGER is 0 Peer_group_uuid_lsb: INTEGER is 15 Pipe_uuid_msb, Characteristic_uuid_msb: INTEGER is 16 Pipe_uuid_lsb, Characteristic_uuid_lsb: INTEGER is 31 end