1. role CompUnit::PrecompilationStore {
  2. # Prepare a new implementation specific PrecompilationUnit for storage
  3. method new-unit(| --> CompUnit::PrecompilationUnit:D)
  4. { ... }
  5. # Load the precompilation identified by the pairing of the specified
  6. # compiler and precompilation ID.
  7. method load-unit(CompUnit::PrecompilationId $compiler-id,
  8. CompUnit::PrecompilationId $precomp-id)
  9. { ... }
  10. # Return the repository id for which the specified precomp file's
  11. # dependencies have been validated
  12. method load-repo-id(CompUnit::PrecompilationId $compiler-id,
  13. CompUnit::PrecompilationId $precomp-id)
  14. { ... }
  15. # Store the file at the specified path in the precompilation store,
  16. # under the given compiler ID and precompilation ID.
  17. method store-file(CompUnit::PrecompilationId $compiler-id,
  18. CompUnit::PrecompilationId $precomp-id,
  19. IO::Path:D $path,
  20. :$extension = '')
  21. { ... }
  22. # Store the given precompilation unit in the precompilation store
  23. # under the given compiler ID and precompilation ID.
  24. method store-unit(CompUnit::PrecompilationId $compiler-id,
  25. CompUnit::PrecompilationId $precomp-id,
  26. CompUnit::PrecompilationUnit $unit)
  27. { ... }
  28. # Store the given repo-id for a precompilation under the given
  29. # compiler ID and precompilation ID.
  30. method store-repo-id(CompUnit::PrecompilationId $compiler-id,
  31. CompUnit::PrecompilationId $precomp-id,
  32. :$repo-id!)
  33. { ... }
  34. # Delete an individual precompilation.
  35. method delete(CompUnit::PrecompilationId $compiler-id,
  36. CompUnit::PrecompilationId $precomp-id)
  37. { ... }
  38. # Delete all precompilations for a particular compiler.
  39. method delete-by-compiler(CompUnit::PrecompilationId $compiler-id)
  40. { ... }
  41. }