var.inline.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef AFUN_VAR_INLINE_H
  2. #define AFUN_VAR_INLINE_H
  3. #include "var.h"
  4. namespace aFuncore {
  5. inline Object *Var::getData() {
  6. return data;
  7. }
  8. inline void Var::setData(Object *data_) {
  9. data = data_;
  10. }
  11. inline size_t VarSpace::getCount() const {return count;}
  12. inline Object *VarSpace::findObject(const std::string &name) {
  13. Var *ret = findVar(name);
  14. return ret ? ret->getData() : nullptr;
  15. }
  16. inline ProtectVarSpace::ProtectVarSpace(Inter *inter_) : VarSpace(inter_), is_protect{false} {
  17. }
  18. inline bool ProtectVarSpace::getProtect() const {
  19. return is_protect;
  20. }
  21. inline bool ProtectVarSpace::setProtect(bool protect) {
  22. bool ret = is_protect; is_protect = protect; return ret;
  23. }
  24. inline VarList::VarList(VarSpace *varspace) {
  25. this->varspace.push_front(varspace);
  26. }
  27. inline void VarList::push(VarSpace *varspace_) {
  28. varspace.push_front(varspace_);
  29. }
  30. inline Object *VarList::findObject(const std::string &name) {
  31. Var *var = findVar(name);
  32. return var ? var->getData() : nullptr;
  33. }
  34. }
  35. #endif //AFUN_VAR_INLINE_H