varlist.inline.h 684 B

1234567891011121314151617181920212223242526
  1. #ifndef AFUN_VARLIST_INLINE_H
  2. #define AFUN_VARLIST_INLINE_H
  3. #include "varlist.h"
  4. namespace aFuncore {
  5. inline VarList::VarList(VarSpace *varspace) {
  6. this->varspace.push_front(varspace);
  7. }
  8. inline void VarList::push(VarSpace *varspace_) {
  9. std::unique_lock<std::mutex> mutex{lock};
  10. varspace.push_front(varspace_);
  11. }
  12. inline Object *VarList::findObject(const std::string &name) {
  13. Var *var = findVar(name);
  14. return var ? var->getData() : nullptr;
  15. }
  16. inline void VarList::GcLinkObject(std::queue<Object *> &queue) {
  17. for (auto var : varspace)
  18. queue.push(var);
  19. }
  20. }
  21. #endif //AFUN_VARLIST_INLINE_H