indexing description: "Represents a module class id" author: "Beat Strasser " date: "$Date$" revision: "$Revision$" class P2P_MODULE_CLASS_ID inherit P2P_UUID create make_from_urn, make, make_new feature {NONE} -- Initialization make (class_uuid, role_uuid: like bytes) is -- Create module class id with `class_uuid' require Class_uuid_valid: class_uuid /= Void and class_uuid.count = uuid_bytes_count Role_uuid_valid: role_uuid /= Void and role_uuid.count = uuid_bytes_count do initialize_bytes bytes.subcopy (class_uuid, 0, uuid_bytes_count - 1, class_uuid_msb) bytes.subcopy (role_uuid, 0, uuid_bytes_count - 1, role_uuid_msb) build_uuidformat end make_new is -- Create new module class id with new class uuid and zeroed role uuid local role: like bytes do create role.make (0, uuid_bytes_count) make (new_uuid, role) end feature -- Access flag_id_type: NATURAL_8 is 5 base_class: like bytes is -- Base class UUID do Result := bytes.subarray (class_uuid_msb, class_uuid_lsb) end base_class_id: P2P_MODULE_CLASS_ID is -- Create base class id with zeroed role uuid local role: like bytes do create role.make (0, uuid_bytes_count) create Result.make (bytes.subarray (class_uuid_msb, class_uuid_lsb), role) end feature -- Comparison has_same_baseclass (other: like Current): BOOLEAN is -- Has `other' id the same base class? do Result := base_class.is_equal (other.base_class) end feature {NONE} -- Implementation Class_uuid_msb: INTEGER is 0 Class_uuid_lsb: INTEGER is 15 Role_uuid_msb: INTEGER is 16 Role_uuid_lsb: INTEGER is 31 end