2
0

object-value.inline.h 874 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef AFUN_OBJECT_VALUE_INLINE_H
  2. #define AFUN_OBJECT_VALUE_INLINE_H
  3. #include "object-value.h"
  4. namespace aFuncore {
  5. inline size_t VarSpace::getCount() {
  6. std::unique_lock<std::mutex> mutex{lock};
  7. return var.size();
  8. }
  9. inline Object *VarSpace::findObject(const std::string &name) {
  10. Var *ret = findVar(name);
  11. return ret ? ret->getData() : nullptr;
  12. }
  13. inline ProtectVarSpace::ProtectVarSpace(Inter &inter) : VarSpace(inter), is_protect{false} {
  14. }
  15. inline ProtectVarSpace::ProtectVarSpace(Environment &env_) : VarSpace(env_), is_protect{false} {
  16. }
  17. inline bool ProtectVarSpace::getProtect() const {
  18. return is_protect;
  19. }
  20. inline bool ProtectVarSpace::setProtect(bool protect) {
  21. bool ret = is_protect; is_protect = protect; return ret;
  22. }
  23. };
  24. #endif //AFUN_OBJECT_VALUE_INLINE_H