ISubsystemInterface.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. namespace NRKernal
  10. {
  11. public interface ILifecycle
  12. {
  13. /// <summary>
  14. /// Starts an instance of a object.
  15. /// </summary>
  16. void Start();
  17. /// <summary>
  18. /// Pause an instance of a object.
  19. /// </summary>
  20. void Pause();
  21. /// <summary>
  22. /// Resume an instance of a object.
  23. /// </summary>
  24. void Resume();
  25. /// <summary>
  26. /// Stops this instance of a object.
  27. /// </summary>
  28. void Stop();
  29. }
  30. public interface ISubsystem : ILifecycle
  31. {
  32. /// <summary>
  33. // Will be true if asking the subsystem to start was successful. False in the case
  34. // that the subsystem has stopped, was asked to stop or has not been started yet.
  35. /// </summary>
  36. bool running { get; }
  37. }
  38. public interface ISubsystemDescriptor
  39. {
  40. /// <summary>
  41. /// A unique string that identifies the subsystem that this Descriptor can create.
  42. /// </summary>
  43. string id { get; }
  44. /// <summary>
  45. /// Creates an ISubsystem from this descriptor.
  46. /// </summary>
  47. /// <returns>An instance of ISubsystem. </returns>
  48. ISubsystem Create();
  49. }
  50. }