2
0

var.inline.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 {
  12. return count;
  13. }
  14. inline Object *VarSpace::findObject(const std::string &name) {
  15. Var *ret = findVar(name);
  16. return ret ? ret->getData() : nullptr;
  17. }
  18. inline ProtectVarSpace::ProtectVarSpace(Inter &inter_) : VarSpace(inter_), is_protect{false} {
  19. }
  20. inline bool ProtectVarSpace::getProtect() const {
  21. return is_protect;
  22. }
  23. inline bool ProtectVarSpace::setProtect(bool protect) {
  24. bool ret = is_protect; is_protect = protect; return ret;
  25. }
  26. inline VarList::VarList(VarSpace *varspace) {
  27. this->varspace.push_front(varspace);
  28. }
  29. inline void VarList::push(VarSpace *varspace_) {
  30. varspace.push_front(varspace_);
  31. }
  32. inline Object *VarList::findObject(const std::string &name) {
  33. Var *var = findVar(name);
  34. return var ? var->getData() : nullptr;
  35. }
  36. }
  37. #endif //AFUN_VAR_INLINE_H