runtimeContainer.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #pragma once
  2. #include <pikaConfig.h>
  3. #include <string>
  4. #include <baseContainer.h>
  5. #include <memoryArena/memoryArena.h>
  6. #include <pikaAllocator/freeListAllocator.h>
  7. #include <IconsForkAwesome.h>
  8. namespace pika
  9. {
  10. struct RuntimeContainer
  11. {
  12. //this is the base adress of the runtime container. here is the beginning of all the allocated memory
  13. void *getBaseAdress() { return arena.containerStructMemory.block; };
  14. char baseContainerName[50] = {};
  15. //std::string name = {};
  16. //this is the pointer to the container virtual class
  17. Container *pointer = {};
  18. //this is the container memory arena. here we have all the static data of the container
  19. pika::memory::MemoryArena arena = {};
  20. //this is the allocator of the arena.
  21. pika::memory::FreeListAllocator allocator = {};
  22. size_t totalSize = 0;
  23. //bonus allocators
  24. pika::StaticVector<pika::memory::FreeListAllocator, MaxAllocatorsCount> bonusAllocators = {};
  25. RequestedContainerInfo requestedContainerInfo = {};
  26. int imguiWindowId = 0;
  27. struct FLAGS
  28. {
  29. enum
  30. {
  31. STATUS_PAUSE = 0,
  32. STATUS_RUNNING = 1,
  33. STATUS_BEING_RECORDED = 2,
  34. STATUS_BEING_PLAYBACK = 3,
  35. };
  36. int status = STATUS_RUNNING;
  37. bool shouldCallReaload = 0; //if the container happens to be on pause when the dll reloads we mark this to true
  38. char recordingName[256] = {};
  39. int frameNumber = 0;
  40. const char *getStatusName()
  41. {
  42. if (status == STATUS_RUNNING)
  43. {
  44. return "running.";
  45. }
  46. else if(status == STATUS_PAUSE)
  47. {
  48. if (shouldCallReaload)
  49. {
  50. return "paused, waiting reload.";
  51. }
  52. else
  53. {
  54. return "paused.";
  55. }
  56. }
  57. else if (status == STATUS_BEING_RECORDED)
  58. {
  59. return "on recording";
  60. }
  61. else if (status == STATUS_BEING_PLAYBACK)
  62. {
  63. return "on input playback";
  64. }
  65. }
  66. const char *getStatusIcon()
  67. {
  68. if (status == STATUS_RUNNING)
  69. {
  70. return ICON_FK_BOLT;
  71. }
  72. else if (status == STATUS_PAUSE)
  73. {
  74. return ICON_FK_PAUSE_CIRCLE_O;
  75. }
  76. else if (status == STATUS_BEING_RECORDED)
  77. {
  78. return ICON_FK_VIDEO_CAMERA;
  79. }
  80. else if (status == STATUS_BEING_PLAYBACK)
  81. {
  82. return ICON_FK_REPEAT;
  83. }
  84. }
  85. }flags;
  86. };
  87. }