The Perl 5 module Class::XSAccessor implements fast read, write and read/write accessors in XS. Additionally, it can provide predicates such as has_foo() for testing whether the attribute foo is defined in the object. It only works with objects that are implemented as ordinary hashes.