Such objects need to add AptPkg::hash to @ISA, provide get, set and exists methods, and an iterator class.
This means that both $obj->method() and $obj->{key} valid, the latter invoking get/set (through FETCH/STORE).
The tie associates an array reference with the hash, which initially contains a reference to the hash, the XS object and an anon hash which may be used by subclasses to store state information.
If no XS object is passed, one is created via new in the XS class. The name of that class is constructed from the class name, by lower-casing the last component and prefixing it with an underscore (eg. AptPkg::Config becomes AptPkg::_config).
If the module contains a @KEYS array, then the private hash will be populated with those entries as keys (see the description below of the AptPkg::hash::method class).
The XS object, the private hash and any arguments are passed to the constructor.
In an array context, the iterator is used to generate a list of keys which are then returned.
The iterator class must implement a next method, which returns the current key and advances to the next.
Classes inheriting from AptPkg::hash::method should provide an iterator class which inherits from AptPkg::hash::method::iter.