inter.inline.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef AFUN_INTER_INLINE_H
  2. #define AFUN_INTER_INLINE_H
  3. #include "inter.h"
  4. namespace aFuncore {
  5. inline Environment &Inter::getEnvironment() {
  6. return env;
  7. }
  8. inline void Inter::pushActivation(Activation *new_activation) {
  9. activation = new_activation;
  10. }
  11. inline Inter::InterStatus Inter::getStatus() const {
  12. return status;
  13. }
  14. inline bool Inter::isInterStop() const {
  15. return (status == inter_exit || status == inter_stop);
  16. }
  17. inline bool Inter::isInterExit() const {
  18. return (status == inter_exit);
  19. }
  20. inline ProtectVarSpace *Inter::getProtectVarSpace() const {
  21. return env.protect;
  22. }
  23. inline VarSpace *Inter::getGlobalVarSpace() const {
  24. return env.global;
  25. }
  26. inline VarList *Inter::getGlobalVarlist() const {
  27. return env.global_varlist;
  28. }
  29. inline Activation *Inter::getActivation() const {
  30. return activation;
  31. }
  32. inline EnvVarSpace &Inter::getEnvVarSpace() {
  33. return env.envvar;
  34. }
  35. inline InterMessage &Inter::getOutMessageStream() {
  36. return out;
  37. }
  38. inline InterMessage &Inter::getInMessageStream() {
  39. return in;
  40. }
  41. inline size_t Environment::operator++(){
  42. return ++reference;
  43. }
  44. inline size_t Environment::operator--(){
  45. return --reference;
  46. }
  47. inline size_t Environment::operator++(int){
  48. return reference++;
  49. }
  50. inline size_t Environment::operator--(int){
  51. return reference--;
  52. }
  53. inline Inter::InterStatus Inter::setInterStop() {
  54. InterStatus ret = status;
  55. if (status != inter_exit)
  56. status = inter_stop;
  57. return ret;
  58. }
  59. inline Inter::InterStatus Inter::setInterExit() {
  60. InterStatus ret = status;
  61. status = inter_exit;
  62. return ret;
  63. }
  64. }
  65. #endif //AFUN_INTER_INLINE_H