inversion-0.1.vapi 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* inversion-0.1.vapi generated by valac 0.56.19, do not modify. */
  2. [CCode (gir_namespace = "inversion", gir_version = "0.1")]
  3. namespace Inversion {
  4. [CCode (cheader_filename = "inversion-0.1.h")]
  5. public class Container : GLib.Object {
  6. public Container ();
  7. public T configure_with<T> () throws GLib.Error;
  8. public Inversion.Scope create_scope ();
  9. public Inversion.Scope create_transient_scope ();
  10. public Invercargill.Enumerable<Inversion.Registration> get_all_registrations ();
  11. public Inversion.Registration get_registration (GLib.Type service_type) throws Inversion.ContainerError;
  12. public Invercargill.Enumerable<Inversion.Registration> get_registrations (GLib.Type service_type);
  13. public void initialise () throws GLib.Error;
  14. public bool is_registered (GLib.Type type);
  15. public Inversion.Registration register<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func, Inversion.Lifecycle lifecycle);
  16. public Inversion.Registration register_factory<T> (Inversion.Factory factory, Inversion.Lifecycle lifecycle);
  17. public Inversion.Registration register_factory_type (GLib.Type implementation_type, Inversion.Factory factory, Inversion.Lifecycle lifecycle);
  18. public Inversion.Registration register_module<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null) throws GLib.Error;
  19. public Inversion.Registration register_module_factory_type (GLib.Type type, Inversion.Factory factory) throws GLib.Error;
  20. public Inversion.Registration register_module_type (GLib.Type type, owned Inversion.FactoryDelegate? factory_func = null) throws GLib.Error;
  21. public Inversion.Registration register_scoped<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
  22. public Inversion.Registration register_singleton<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
  23. public Inversion.Registration register_startup<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
  24. public Inversion.Registration register_transient<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
  25. public Inversion.Registration register_type (GLib.Type implementation_type, owned Inversion.FactoryDelegate? factory_func, Inversion.Lifecycle lifecycle);
  26. }
  27. [CCode (cheader_filename = "inversion-0.1.h")]
  28. public class DelegateFactory : GLib.Object, Inversion.Factory {
  29. public DelegateFactory (owned Inversion.FactoryDelegate @delegate);
  30. public static Inversion.DelegateFactory typed<T> (owned Inversion.TypedFactoryDelegate<T> @delegate);
  31. }
  32. [CCode (cheader_filename = "inversion-0.1.h")]
  33. public class InjectionContext {
  34. public InjectionContext (Inversion.Scope scope, GLib.Type requested_type, Inversion.Registration registration, Inversion.InjectionContext? previous = null);
  35. public GLib.Error? error { get; set; }
  36. public Inversion.InjectionContext? previous_context { get; set; }
  37. public Inversion.Registration registration { get; set; }
  38. public GLib.Type requested_type { get; set; }
  39. public Inversion.Scope scope { get; set; }
  40. public Invercargill.DataStructures.HashSet<Inversion.Registration> stack_registrations { get; set; }
  41. }
  42. [CCode (cheader_filename = "inversion-0.1.h")]
  43. public class InstanceFactory : GLib.Object, Inversion.Factory {
  44. public InstanceFactory (Inversion.Registration registration, GLib.Object instance);
  45. public Inversion.Registration registration { get; set construct; }
  46. }
  47. [CCode (cheader_filename = "inversion-0.1.h")]
  48. public class ObjectFactory : GLib.Object, Inversion.Factory {
  49. public ObjectFactory (GLib.Type instance_type);
  50. public GLib.Type instance_type { get; construct; }
  51. }
  52. [CCode (cheader_filename = "inversion-0.1.h")]
  53. public class Registration : GLib.Object {
  54. public Registration (GLib.Type implementation_type, Inversion.Factory factory, Inversion.Lifecycle lifecycle);
  55. public Inversion.Registration @as<T> ();
  56. public Inversion.Registration as_type (GLib.Type type);
  57. public Invercargill.Enumerable<T> get_metadata<T> ();
  58. public Invercargill.Enumerable<GLib.Object> get_metadata_type (GLib.Type type);
  59. public bool provides (GLib.Type type);
  60. public Inversion.Registration with_metadata<T> (T metadata);
  61. public Inversion.Registration with_metadata_type (GLib.Type type, GLib.Object metadata);
  62. public Inversion.Factory factory { get; set construct; }
  63. public GLib.Type implementation_type { get; set construct; }
  64. public Inversion.Lifecycle lifecycle { get; set construct; }
  65. public Invercargill.ImmutableLot<GLib.Type> type_aliases { get; private set; }
  66. public signal void alias_added (GLib.Type alias);
  67. }
  68. [CCode (cheader_filename = "inversion-0.1.h")]
  69. public class Scope : GLib.Object {
  70. public Invercargill.Enumerable<Inversion.Registration> get_all_registrations ();
  71. public Invercargill.Enumerable<Inversion.Registration> get_local_registrations (GLib.Type service_type);
  72. public Inversion.Registration get_registration (GLib.Type service_type) throws Inversion.ContainerError;
  73. public Invercargill.Enumerable<Inversion.Registration> get_registrations (GLib.Type service_type);
  74. public bool is_locally_registered (GLib.Type type);
  75. public bool is_registered (GLib.Type type);
  76. public Inversion.Registration register_local<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null, Inversion.Lifecycle lifecycle = Lifecycle.SCOPED);
  77. public Inversion.Registration register_local_factory<T> (Inversion.Factory factory, Inversion.Lifecycle lifecycle);
  78. public Inversion.Registration register_local_factory_type (GLib.Type implementation_type, Inversion.Factory factory, Inversion.Lifecycle lifecycle);
  79. public Inversion.Registration register_local_scoped<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
  80. public Inversion.Registration register_local_transient<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
  81. public Inversion.Registration register_local_type (GLib.Type implementation_type, owned Inversion.FactoryDelegate? factory_func, Inversion.Lifecycle lifecycle);
  82. public void release ();
  83. public T resolve<T> () throws GLib.Error;
  84. public Invercargill.Enumerable<T> resolve_all<T> () throws GLib.Error;
  85. public Invercargill.Enumerable<GLib.Object> resolve_all_type (GLib.Type type) throws GLib.Error;
  86. public GLib.Object resolve_registration (Inversion.Registration registration) throws GLib.Error;
  87. public GLib.Object resolve_type (GLib.Type type) throws GLib.Error;
  88. public Inversion.Container container { get; set construct; }
  89. public Inversion.Lifecycle scope_lifecycle { get; set construct; }
  90. }
  91. [CCode (cheader_filename = "inversion-0.1.h")]
  92. public interface Factory : GLib.Object {
  93. public abstract GLib.Object create (Inversion.Scope scope) throws GLib.Error;
  94. }
  95. [CCode (cheader_filename = "inversion-0.1.h")]
  96. public interface Module : GLib.Object {
  97. public abstract void register_components (Inversion.Container container) throws GLib.Error;
  98. }
  99. [CCode (cheader_filename = "inversion-0.1.h")]
  100. public enum Lifecycle {
  101. TRANSIENT,
  102. SCOPED,
  103. SINGLETON,
  104. STARTUP
  105. }
  106. [CCode (cheader_filename = "inversion-0.1.h")]
  107. public errordomain ContainerError {
  108. NOT_REGISTERED,
  109. CYCLE_DETECTED,
  110. ILLEGAL_LIFECYCLE_COMBINATION,
  111. INCOMPATIBLE_TYPE
  112. }
  113. [CCode (cheader_filename = "inversion-0.1.h")]
  114. public delegate GLib.Object FactoryDelegate (Inversion.Scope scope) throws GLib.Error;
  115. [CCode (cheader_filename = "inversion-0.1.h")]
  116. public delegate T TypedFactoryDelegate<T> (Inversion.Scope scope) throws GLib.Error;
  117. [CCode (cheader_filename = "inversion-0.1.h")]
  118. public static GLib.Object create_with_injection_context (Inversion.Scope scope, GLib.Type requested_type, Inversion.Registration registration) throws GLib.Error;
  119. [CCode (cheader_filename = "inversion-0.1.h")]
  120. public static Inversion.InjectionContext enter_new_injection_context (Inversion.Scope scope, GLib.Type requested_type, Inversion.Registration registration) throws GLib.Error;
  121. [CCode (cheader_filename = "inversion-0.1.h")]
  122. public static void exit_injection_context () throws GLib.Error;
  123. [CCode (cheader_filename = "inversion-0.1.h")]
  124. public static Inversion.InjectionContext get_injection_context ();
  125. [CCode (cheader_filename = "inversion-0.1.h")]
  126. public static T inject<T> ();
  127. [CCode (cheader_filename = "inversion-0.1.h")]
  128. public static Invercargill.Lot<T> inject_all<T> ();
  129. [CCode (cheader_filename = "inversion-0.1.h")]
  130. public static Inversion.InjectionContext? try_get_injection_context ();
  131. [CCode (cheader_filename = "inversion-0.1.h")]
  132. public static T try_inject<T> ();
  133. [CCode (cheader_filename = "inversion-0.1.h")]
  134. public static Invercargill.Lot<T> try_inject_all<T> ();
  135. }