View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Marcus Holland-Moritz > Convert-Binary-C > Convert::Binary::C::Cached



Annotate this POD



New  1
Open  3
Stalled  2
View/Report Bugs
Module Version: 0.78   Source  


Convert::Binary::C::Cached - Caching for Convert::Binary::C


  use Convert::Binary::C::Cached;
  use Data::Dumper;
  # Create a cached object
  $c = Convert::Binary::C::Cached->new(
         Cache   => '/tmp/cache.c',
         Include => [
  # Parse 'time.h' and dump the definition of timespec
  print Dumper($c->struct('timespec'));


Convert::Binary::C::Cached simply adds caching capability to Convert::Binary::C. You can use it in just the same way that you would use Convert::Binary::C. The interface is exactly the same.

To use the caching capability, you must pass the Cache option to the constructor. If you don't pass it, you will receive an ordinary Convert::Binary::C object. The argument to the Cache option is the file that is used for caching this object.

The caching algorithm automatically detects when the cache file cannot be used and the original code has to be parsed. In that case, the cache file is updated. An update of the cache file can be triggered by one or more of the following factors:


You cannot call parse or parse_file more that once when using a Convert::Binary::C::Cached object. This isn't a big problem, as you usually don't call them multiple times.

If a dependency file changes, but the change affects neither the size nor the timestamps of that file, the caching algorithm cannot detect that an update is required.


Copyright (c) 2002-2015 Marcus Holland-Moritz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


See Convert::Binary::C.

syntax highlighting: